-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add translation function: vsac --> internal valueset (#41)
Co-authored-by: Rob Mitchell <[email protected]>
- Loading branch information
1 parent
09795b4
commit ffbe1cd
Showing
4 changed files
with
268 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
{ | ||
"resourceType": "ValueSet", | ||
"id": "2.16.840.1.113762.1.4.1146.170", | ||
"meta": { | ||
"versionId": "58", | ||
"lastUpdated": "2023-12-21T17:43:03.000-05:00", | ||
"profile": [ | ||
"http://hl7.org/fhir/StructureDefinition/shareablevalueset", | ||
"http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-valueset-cqfm", | ||
"http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-valueset-cqfm" | ||
] | ||
}, | ||
"extension": [ | ||
{ | ||
"url": "http://hl7.org/fhir/StructureDefinition/valueset-author", | ||
"valueContactDetail": { | ||
"name": "CSTE Author" | ||
} | ||
}, | ||
{ | ||
"url": "http://hl7.org/fhir/StructureDefinition/valueset-keyWord", | ||
"valueString": "Chlamydia,G_STI,Trigger" | ||
}, | ||
{ | ||
"url": "http://hl7.org/fhir/StructureDefinition/resource-lastReviewDate", | ||
"valueDate": "2024-06-05" | ||
}, | ||
{ | ||
"url": "http://hl7.org/fhir/StructureDefinition/valueset-effectiveDate", | ||
"valueDate": "2023-06-02" | ||
} | ||
], | ||
"url": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.170", | ||
"identifier": [ | ||
{ | ||
"system": "urn:ietf:rfc:3986", | ||
"value": "urn:oid:2.16.840.1.113762.1.4.1146.170" | ||
} | ||
], | ||
"version": "20230602", | ||
"name": "ChlamydiaTrachomatisInfectionOrganismOrSubstanceInLabResults", | ||
"title": "Chlamydia trachomatis Infection (Organism or Substance in Lab Results)", | ||
"status": "active", | ||
"date": "2023-06-02T01:03:51-04:00", | ||
"publisher": "CSTE Steward", | ||
"jurisdiction": [ | ||
{ | ||
"extension": [ | ||
{ | ||
"url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason", | ||
"valueCode": "unknown" | ||
} | ||
] | ||
} | ||
], | ||
"purpose": "(Clinical Focus: This set of values contains organisms or substances relevant for reporting Chlamydia),(Data Element Scope: Organism names reported in laboratory results),(Inclusion Criteria: Chlamydia trachomatis organism or Chlamydia trachomatis substance),(Exclusion Criteria: antibody substances)", | ||
"compose": { | ||
"include": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"concept": [ | ||
{ | ||
"code": "115289001", | ||
"display": "Chlamydia trachomatis, serotype A (organism)" | ||
}, | ||
{ | ||
"code": "115290005", | ||
"display": "Chlamydia trachomatis, serotype B (organism)" | ||
}, | ||
{ | ||
"code": "115291009", | ||
"display": "Chlamydia trachomatis, serotype Ba (organism)" | ||
}, | ||
{ | ||
"code": "115292002", | ||
"display": "Chlamydia trachomatis, serotype C (organism)" | ||
}, | ||
{ | ||
"code": "115293007", | ||
"display": "Chlamydia trachomatis, serotype D (organism)" | ||
}, | ||
{ | ||
"code": "115294001", | ||
"display": "Chlamydia trachomatis, serotype E (organism)" | ||
}, | ||
{ | ||
"code": "115295000", | ||
"display": "Chlamydia trachomatis, serotype F (organism)" | ||
}, | ||
{ | ||
"code": "115296004", | ||
"display": "Chlamydia trachomatis, serotype I (organism)" | ||
}, | ||
{ | ||
"code": "115297008", | ||
"display": "Chlamydia trachomatis, serotype J (organism)" | ||
}, | ||
{ | ||
"code": "115298003", | ||
"display": "Chlamydia trachomatis, serotype K (organism)" | ||
}, | ||
{ | ||
"code": "115299006", | ||
"display": "Chlamydia trachomatis, serotype L (organism)" | ||
}, | ||
{ | ||
"code": "115300003", | ||
"display": "Chlamydia trachomatis, serotype L1 (organism)" | ||
}, | ||
{ | ||
"code": "115301004", | ||
"display": "Chlamydia trachomatis, serotype L2 (organism)" | ||
}, | ||
{ | ||
"code": "115318000", | ||
"display": "Chlamydia trachomatis, serotype L3 (organism)" | ||
}, | ||
{ | ||
"code": "115319008", | ||
"display": "Chlamydia trachomatis, serotype G (organism)" | ||
}, | ||
{ | ||
"code": "115328009", | ||
"display": "Chlamydia trachomatis, serotype H (organism)" | ||
}, | ||
{ | ||
"code": "121002007", | ||
"display": "Antigen of Chlamydia trachomatis (substance)" | ||
}, | ||
{ | ||
"code": "121015003", | ||
"display": "Antigen of Chlamydia trachomatis serotype F (substance)" | ||
}, | ||
{ | ||
"code": "121016002", | ||
"display": "Antigen of Chlamydia trachomatis serotype G (substance)" | ||
}, | ||
{ | ||
"code": "121017006", | ||
"display": "Antigen of Chlamydia trachomatis serotype K (substance)" | ||
}, | ||
{ | ||
"code": "121106008", | ||
"display": "Ribosomal ribonucleic acid of Chlamydia trachomatis (substance)" | ||
}, | ||
{ | ||
"code": "121181000", | ||
"display": "Deoxyribonucleic acid of Chlamydia trachomatis (substance)" | ||
}, | ||
{ | ||
"code": "442505006", | ||
"display": "Chlamydia trachomatis, serotype Ja (organism)" | ||
}, | ||
{ | ||
"code": "454431000124102", | ||
"display": "Chlamydia trachomatis nucleic acid detected (finding)" | ||
}, | ||
{ | ||
"code": "59134003", | ||
"display": "Lymphogranuloma venereum antigen (substance)" | ||
}, | ||
{ | ||
"code": "63938009", | ||
"display": "Chlamydia trachomatis (organism)" | ||
}, | ||
{ | ||
"code": "708219005", | ||
"display": "Deoxyribonucleic acid of Chlamydia trachomatis L2 (substance)" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
query-connector/src/app/tests/integration/translation.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { DEFAULT_ERSD_VERSION, ValueSet } from "@/app/constants"; | ||
import ExampleVsacValueSet from "../assets/VSACValueSet.json"; | ||
import { translateVSACToInternalValueSet } from "../../database-service"; | ||
import { ValueSet as FhirValueSet } from "fhir/r4"; | ||
|
||
const EXPECTED_INTERNAL_VALUESET: ValueSet = { | ||
valueSetId: ExampleVsacValueSet.id, | ||
valueSetVersion: DEFAULT_ERSD_VERSION, | ||
valueSetName: ExampleVsacValueSet.title, | ||
author: ExampleVsacValueSet.publisher, | ||
system: ExampleVsacValueSet.compose.include[0].system, | ||
ersdConceptType: "ostc", | ||
dibbsConceptType: "labs", | ||
includeValueSet: false, | ||
concepts: ExampleVsacValueSet.compose.include[0].concept.map((c) => { | ||
return { ...c, include: false }; | ||
}), | ||
}; | ||
|
||
describe("VSAC FHIR response to internal application type", () => { | ||
it("translate to expected fixture", async () => { | ||
const translationResult = await translateVSACToInternalValueSet( | ||
ExampleVsacValueSet as FhirValueSet, | ||
"ostc", | ||
); | ||
|
||
expect(translationResult).toEqual(EXPECTED_INTERNAL_VALUESET); | ||
}); | ||
}); |