From d108600dabb48051795899f0bceca181d0b07c8c Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Thu, 10 Nov 2022 12:29:32 -0500 Subject: [PATCH] metadata: fix profile to be string, not dict Per the FHIR spec, it is defined as a canonical URL (string): https://www.hl7.org/fhir/capabilitystatement.html And in fhirclient, it is validated as a string. The current dictionary definition makes it impossible to use fhirclient to inspect server metadata. And removed non-spec parameter acceptUnknown --- fhir/metadata.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fhir/metadata.ts b/fhir/metadata.ts index bbe260f..63984e8 100644 --- a/fhir/metadata.ts +++ b/fhir/metadata.ts @@ -97,9 +97,9 @@ class CapabilityStatement }, { "type": "OperationDefinition", - "profile": { - "reference": "http://hl7.org/fhir/Profile/OperationDefinition" - }, + "profile": this.stu === 4 ? + "http://hl7.org/fhir/Profile/OperationDefinition" : + { "reference": "http://hl7.org/fhir/Profile/OperationDefinition" }, "interaction": [ { "code": "read" @@ -155,7 +155,7 @@ class CapabilityStatement "description": "SMART Sample Bulk Data Server" }, fhirVersion: getFhirVersion(this.stu), - acceptUnknown: "extensions", + ...(this.stu < 4 && {acceptUnknown: "extensions"}), format: [ "json" ], rest: [ {