Skip to content

Commit

Permalink
BFD-3818: IDR-based mapping of Patient resource using FHIR Mapping La…
Browse files Browse the repository at this point in the history
…nguage (#2541)
  • Loading branch information
alex-dzeda authored Feb 6, 2025
1 parent eeefe74 commit 3cc7ece
Show file tree
Hide file tree
Showing 9 changed files with 835 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
# NOTE: The expression below can be extended to multi-line
# using a '\' as a continuation character.
# https://stackoverflow.com/questions/6268391/is-there-a-way-to-represent-a-long-string-that-doesnt-have-any-whitespace-on-mul
workflow_files_re: "^apps/(?!bfd-pipeline/bfd-pipeline-idr|utils).+$|^.github/workflows/ci-java.yml$"
workflow_files_re: "^apps/(?!bfd-pipeline/bfd-pipeline-idr|bfd-model/bfd-model-idr|utils).+$|^.github/workflows/ci-java.yml$"

jobs:
workflow:
Expand Down
38 changes: 38 additions & 0 deletions apps/bfd-model/bfd-model-idr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Placeholder directories + structures for mapping between IDR and FHIR.

To download the FHIR Validator:
https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar

To execute FHIR Mapping language transforms against the sample data.
To compile the StructureMap:
```sh
java -jar validator_cli.jar -ig maps/patient.map \
-compile https://bfd.cms.gov/MappingLanguage/Resources/Patient \
-version 4.0.1 -output StructureMaps/bfd_patient_structuremap.json
```

To execute:
```sh
java -jar validator_cli.jar sample-data/BeneficiarySample.json \
-output outputs/Patient.json \
-transform https://bfd.cms.gov/MappingLanguage/Resources/Patient \
-version 4.0.1 \
-ig StructureMaps/bfd_patient_structuremap.json \
-ig StructureDefinitions/Source/Bene-MBI.json \
-ig StructureDefinitions/Source/Bene.json \
-ig hl7.fhir.us.carin-bb#2.0.0 \
-ig maps/Patient-Helper.map
```


Validating sample resources against self-defined StructureDefinitions:
```sh
java -jar validator_cli.jar sample-data/<input>.json \
-ig StructureDefinitions/Source/<applicable structure definition>.json
```

Validate against C4BB:
```sh
java -jar validator_cli.jar outputs/<output_json>.json \
-ig hl7.fhir.us.carin-bb#2.0.0
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"resourceType": "StructureDefinition",
"id": "BENE_MBI",
"url": "http://hl7.org/fhir/StructureDefinition/BeneficiaryMBIIdentifier",
"name": "BENE_MBI",
"status": "draft",
"fhirVersion": "4.0.1",
"kind": "logical",
"abstract": true,
"type": "BeneficiaryMBIIdentifier",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Base",
"derivation": "specialization",
"differential": {
"element": [
{
"id": "BeneficiaryMBIIdentifier",
"path": "BeneficiaryMBIIdentifier",
"label": "IDR MBI Base Resource. Ignore in DD Generation",
"definition": "BeneficiaryMBIIdentifier definition",
"min": 1,
"max": "1"
},
{
"id": "BeneficiaryMBIIdentifier.BENE_MBI_ID",
"path": "BeneficiaryMBIIdentifier.BENE_MBI_ID",
"label": "MBI ID",
"definition": "Medicare Beneficiary Identifier",
"min": 1,
"max": "1",
"type": [
{
"code": "string"
}
]
},
{
"id": "BeneficiaryMBIIdentifier.BENE_MBI_EFCTV_DT",
"path": "BeneficiaryMBIIdentifier.BENE_MBI_EFCTV_DT",
"label": "MBI Effective Date",
"definition": "Effective date of this MBI.",
"min": 1,
"max": "1",
"type": [
{
"code": "dateTime"
}
]
},
{
"id": "BeneficiaryMBIIdentifier.BENE_MBI_OBSLT_DT",
"path": "BeneficiaryMBIIdentifier.BENE_MBI_OBSLT_DT",
"label": "MBI Obsolete Date",
"definition": "Date this MBI was marked obsolete.",
"min": 0,
"max": "1",
"type": [
{
"code": "dateTime"
}
]
}
]
}
}
Loading

0 comments on commit 3cc7ece

Please sign in to comment.