ahdis / ch-emed-pmp

FHIR Implementation Guide
1 stars 0 forks source link

id of contained resources #49

Closed ziegm closed 1 year ago

ziegm commented 1 year ago

the id's of the contained resources within the same container resource have to be different (even if the resource type is already different).

example snippet from a pmp list document, where it have a duplicated id (practitioner "1", practitionerrole "1"):

                       {
                            "resourceType": "MedicationRequest",
                            "meta": {
                                "profile": [
                                    "https://fhir.cara.ch/StructureDefinition/ch-emed-epr-medicationrequest-list"
                                ]
                            },
                            "contained": [{
                                    "resourceType": "Medication",
                                    "id": "medication-2",
                                    "meta": {
                                        "profile": [
                                            "https://fhir.cara.ch/StructureDefinition/ch-emed-epr-medication"
                                        ]
                                    },
                                    "code": {
                                        "coding": [{
                                                "system": "urn:oid:2.51.1.1",
                                                "code": "7680500440334",
                                                "display": "NORVASC Tabl 10 mg"
                                            }
                                        ],
                                        "text": "NORVASC Tabl 10 mg"
                                    },
                                    "form": {
                                        "coding": [{
                                                "system": "urn:oid:0.4.0.127.0.16.1.1.2.1",
                                                "code": "10219000",
                                                "display": "Tablet"
                                            }
                                        ]
                                    },
                                    "amount": {
                                        "numerator": {
                                            "value": 30,
                                            "unit": "Tablet (unit of presentation)",
                                            "system": "http://snomed.info/sct",
                                            "code": "732936001"
                                        },
                                        "denominator": {
                                            "value": 1,
                                            "unit": "Package",
                                            "system": "http://unitsofmeasure.org",
                                            "code": "{Package}"
                                        }
                                    },
                                    "ingredient": [{
                                            "itemCodeableConcept": {
                                                "coding": [{
                                                        "system": "http://snomed.info/sct",
                                                        "code": "386864001",
                                                        "display": "Amlodipine (substance)"
                                                    }
                                                ],
                                                "text": "Amlodipine"
                                            },
                                            "strength": {
                                                "numerator": {
                                                    "value": 10,
                                                    "unit": "milligram",
                                                    "system": "http://unitsofmeasure.org",
                                                    "code": "mg"
                                                },
                                                "denominator": {
                                                    "value": 1,
                                                    "unit": "Tablet (unit of presentation)",
                                                    "system": "http://snomed.info/sct",
                                                    "code": "732936001"
                                                }
                                            }
                                        }
                                    ]
                                }, {
                                    "resourceType": "PractitionerRole",
                                    "id": "1",
                                    "meta": {
                                        "profile": [
                                            "https://fhir.cara.ch/StructureDefinition/ch-emed-epr-practitionerrole"
                                        ]
                                    },
                                    "practitioner": {
                                        "reference": "#1"
                                    },
                                    "organization": {
                                        "reference": "#2"
                                    }
                                }, {
                                    "resourceType": "Practitioner",
                                    "id": "1",
                                    "meta": {
                                        "profile": [
                                            "https://fhir.cara.ch/StructureDefinition/ch-emed-epr-practitioner"
                                        ]
                                    },
                                    "identifier": [{
                                            "system": "urn:oid:2.51.1.3",
                                            "value": "7601000234438"
                                        }
                                    ],
                                    "name": [{
                                            "family": "Hausarzt",
                                            "given": [
                                                "Familien"
                                            ]
                                        }
                                    ]
                                }, {
                                    "resourceType": "Organization",
                                    "id": "2",
                                    "meta": {
                                        "profile": [
                                            "http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-organization"
                                        ]
                                    },
                                    "identifier": [{
                                            "system": "urn:oid:2.51.1.3",
                                            "value": "7601000234438"
                                        }
                                    ],
                                    "name": "Hausarzt",
                                    "address": [{
                                            "line": [
                                                "Krankenstrasse 2"
                                            ],
                                            "city": "Zürich",
                                            "postalCode": "8005",
                                            "country": "CH"
                                        }
                                    ]
                                }
                            ],
                            "extension": [{
                                    "extension": [{
                                            "url": "id",
                                            "valueIdentifier": {
                                                "system": "urn:ietf:rfc:3986",
                                                "value": "urn:uuid:c39fa7f0-d1ff-4245-b038-a9dbaf05dac4"
                                            }
                                        }, {
                                            "url": "externalDocumentId",
                                            "valueIdentifier": {
                                                "system": "urn:ietf:rfc:3986",
                                                "value": "urn:uuid:c39fa7f0-d1ff-4245-b038-a9dbaf05dac4"
                                            }
                                        }
                                    ],
                                    "url": "http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan"
                                }, {
                                    "extension": [{
                                            "url": "id",
                                            "valueIdentifier": {
                                                "system": "urn:ietf:rfc:3986",
                                                "value": "urn:uuid:1a82f387-a153-4138-b783-a63354ef37fa"
                                            }
                                        }, {
                                            "url": "externalDocumentId",
                                            "valueIdentifier": {
                                                "system": "urn:ietf:rfc:3986",
                                                "value": "urn:uuid:1a82f387-a153-4138-b783-a63354ef37fa"
                                            }
                                        }
                                    ],
                                    "url": "http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-prescription"
                                }
                            ],
                            "identifier": [{
                                    "system": "urn:ietf:rfc:3986",
                                    "value": "urn:uuid:1a82f387-a153-4138-b783-a63354ef37fa"
                                }
                            ],
                            "status": "active",
                            "intent": "order",
                            "medicationReference": {
                                "reference": "#medication-2"
                            },
                            "subject": {
                                "reference": "urn:uuid:500471bc-1131-4d05-a2fa-219499f8e687"
                            },
                            "requester": {
                                "reference": "#1"
                            },
                            "reasonCode": [{
                                    "text": "-"
                                }
                            ],
                            "dosageInstruction": [{
                                    "id": "#dosage-2",
                                    "patientInstruction": "-",
                                    "timing": {
                                        "repeat": {
                                            "boundsPeriod": {
                                                "start": "2012-02-04"
                                            },
                                            "when": [
                                                "MORN",
                                                "EVE"
                                            ]
                                        }
                                    },
                                    "route": {
                                        "coding": [{
                                                "system": "urn:oid:0.4.0.127.0.16.1.1.2.1",
                                                "code": "20053000",
                                                "display": "Oral use"
                                            }
                                        ]
                                    },
                                    "doseAndRate": [{
                                            "doseQuantity": {
                                                "value": 1,
                                                "unit": "Tablet (unit of presentation)",
                                                "system": "http://snomed.info/sct",
                                                "code": "732936001"
                                            }
                                        }
                                    ]
                                }
                            ],
                            "dispenseRequest": {
                                "validityPeriod": {
                                    "start": "2012-02-04",
                                    "end": "2012-05-03"
                                }
                            }
                        }
                    }

causes validator errors, because is not able to find the correct resource.

ziegm commented 1 year ago

works, thanks!