Skip to content

Commit

Permalink
Merge pull request #17019 from CDCgov/Flexion/1620-add-PD1-4
Browse files Browse the repository at this point in the history
Add pd1-4 mapping to Patient.generalPractitioner
  • Loading branch information
basiliskus authored Jan 13, 2025
2 parents c942a9a + 0b029d7 commit 3408c7f
Show file tree
Hide file tree
Showing 7 changed files with 2,771 additions and 2,011 deletions.
3 changes: 1 addition & 2 deletions prime-router/docs/design/design/HL7v2-FHIR-Inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ implementation differs from what is in the spreadsheets.

### PD1 -> Patient

- PD1.4 is deprecated in the HL7v2.7 and NIST HL7v2.5.1 specs. Further, the HAPI v2.7 model has set both fields to
NULLDT. Thus, this field is not being mapped.
- PD1.4 Backwards compatible in NIST. Needed for ETOR NBS use case. Mapped to Patient.generalPractitioner.

### PV1 -> Patient

Expand Down
21 changes: 15 additions & 6 deletions prime-router/metadata/HL7/catchall/hl7/segments/PID/Patient.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resourceType: Patient
# to Patient.link which includes a reference to RelatedPerson


# - PD1.4 Deprecated in NIST, set to NullDT in HAPI. Field not mapped
# - PD1.4 Backwards compatible in NIST. Needed for ETOR NBS use case. Mapped to Patient.generalPractitioner.

id:
type: STRING
Expand Down Expand Up @@ -423,14 +423,23 @@ meta:
expressionType: reference
specs: PID.34

generalPractitioner_Organization:
condition: $pd13 NOT_NULL
generalPractitioner:
expressionType: nested
generateList: true
specs: PD1.3 *
vars:
pd13: STRING_ALL, PD1.3
valueOf: datatypes/XON/Organization
expressionType: reference
pd14: STRING_ALL, PD1.4
expressions:
- condition: $pd13 NOT_NULL
valueOf: datatypes/XON/Organization
expressionType: reference
specs: PD1.3 *
generateList: true
- condition: $pd14 NOT_NULL
valueOf: datatypes/XCN/Practitioner
expressionType: reference
specs: PD1.4 *
generateList: true

extension:
expressionType: nested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ elements:
constants:
hl7XONField: '%{hl7PD1Field}-3(%{xonIndex})'

- name: patient-primary-provider
resource: '%resource.generalPractitioner.resolve().ofType(Practitioner)'
schema: classpath:/metadata/hl7_mapping/resources/Practitioner/XCN.yml
resourceIndex: xcnIndex
constants:
hl7XCNField: '%{hl7PD1Field}-4(%{xcnIndex})'

- name: student-indicator
condition: '%context.extension(%`rsext-studentStatus`).exists()'
resource: '%resource.extension(%`rsext-studentStatus`).value'
Expand Down
Loading

0 comments on commit 3408c7f

Please sign in to comment.