1.1.3 • Published 9 days ago

dicomjson-to-fhir v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
9 days ago

dicomjson-to-fhir

Convert dicom json model to FHIR ImagingStudy, Patient, and Endpoint

Installation

npm install dicomjson-to-fhir

Usage

Code

const fs = require("fs");
const path = require("path");
const { DicomJsonToFhir } = require("dicomjson-to-fhir");

let data = fs.readFileSync(
    path.join(__dirname, "./dicomjson.json") 
).toString();

let dicomJsonToFhir = new DicomJsonToFhir(JSON.parse(data), "http://aaExample.com/wado-rs", "my-endpoint");

// Only obtain Endpoint, Patient and ImagingStudy
let fhirJson = dicomJsonToFhir.getFhirJson();

// Add reference fields you need with array to arguments
let fhirJsonFull = dicomJsonToFhir.getFhirJson([
    "basedOn",
    "referrer",
    "interpreter",
    "procedureReference",
    "procedureCode",
    "location",
    "reasonCode",
    "seriesSpecimen",
    "seriesPerformerActor"
]);

console.log(JSON.stringify(fhirJson, null, 2));
{
  "patient": {
    "resourceType": "Patient",
    "id": "0",
    "gender": "unknown",
    "active": true,
    "name": [
      {
        "use": "usual"
      }
    ]
  },
  "endpoint": {
    "resourceType": "Endpoint",
    "status": "active",
    "id": "my-endpoint",
    "connectionType": {
      "system": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type",
      "code": "dicom-wado-rs"
    },
    "payloadType": [
      {
        "text": "DICOM"
      }
    ],
    "payloadMimeType": [
      "application/dicom"
    ],
    "address": "http://aaExample.com/wado-rs"
  },
  "imagingStudy": {
    "resourceType": "ImagingStudy",
    "id": "1.2.826.0.1.3680043.8.1055.1.20111102150758591.92402465.76095170",
    "identifier": [
      {
        "use": "official",
        "system": "urn:dicom:uid",
        "value": "urn:oid:1.2.826.0.1.3680043.8.1055.1.20111102150758591.92402465.76095170"
      }
    ],
    "status": "unknown",
    "subject": {
      "reference": "Patient/0",
      "type": "Patient",
      "identifier": {
        "use": "usual",
        "value": "0"
      }
    },
    "started": "2006-10-12T01:02:58.000Z",
    "description": "CT1abdomen",
    "series": [
      {
        "uid": "1.2.826.0.1.3680043.8.1055.1.20111102150758591.96842950.07877442",
        "number": 6168,
        "modality": {
          "system": "http://dicom.nema.org/resources/ontology/DCM",
          "code": "CT"
        },
        "description": "ARTERIELLE",
        "instance": [
          {
            "uid": "1.2.826.0.1.3680043.8.1055.1.20111102150758591.03296050.69180943",
            "sopClass": {
              "system": "urn:ietf:rfc:3986",
              "code": "urn:oid:1.2.840.10008.5.1.4.1.1.2"
            },
            "number": "1",
            "title": "ORIGINAL"
          }
        ]
      }
    ]
  }
}
1.1.1

9 days ago

1.1.0

9 days ago

1.1.3

9 days ago

1.1.2

9 days ago

1.0.1

4 months ago

1.0.0

4 months ago