1.1.0 • Published 7 months ago

node-java-fhir-validator v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

node-java-fhir-validator

Use node-java-bridge to implement same features as the fhir-validator-wrapper APIs.

Migrate to V1

Requirements

  • JDK >= 11

Ubuntu

  • java 11
sudo apt install openjdk-11-jdk-headless openjdk-11-jre-headless

Usage

  • Put you IG package (package.tgz file) in any folder, here we use "igs"
  • Example:
const path = require("path");
const fs = require("fs");
const { FhirValidator } = require("node-java-fhir-validator");


(async () => {
    let validator = new FhirValidator({
        igDir: path.join(__dirname, "../igs")
    });
    try {
        

        // validate resource example
        let errorItem = fs.readFileSync(path.join(__dirname, "../test/us-core-patient-example-error.json"), "utf-8");
        let validationOperationOutcome = await validator.validateResource(errorItem, "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient");
        console.log(JSON.stringify(validationOperationOutcome, null, 4));

        // validate resource with multiple profiles
        // please using comma to concat profile URLs
        let item = fs.readFileSync(path.join(__dirname, "../test/us-core-patient-example.json"), "utf-8");
        let oo = await validator.validate(item, "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient,http://hl7.org/fhir/StructureDefinition/Patient");
        console.log(JSON.stringify(oo, null, 4));
        
    } catch (e) {
        console.error("err", e);
    }
})();

Options

  • igDir: The directory contain igs
  • isDisableTx: Whether to disable tx server
  • txSeverUrl: the url of the tx server (default is http://tx.fhir.org)
1.1.0

7 months ago

1.0.0

10 months ago

0.3.0

10 months ago

0.4.1

10 months ago

0.4.0

10 months ago

0.3.1

10 months ago

0.2.0

1 year ago

0.1.0

2 years ago