FHIR - Consent Resource - Giving Hl7.Fhir.Serialization.ComplexTypeReader error - hl7-fhir

I am not a techie but have assumed some responsibilities in someone's absence.
Trying to push below Consent FHIR Resource:
<Consent xmlns="http://hl7.org/fhir">
<id value="123" />
<status value="inactive" />
<scope>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/consentscope" />
<code value="patient-privacy" />
</coding>
</scope>
<category>
<coding>
<system value="http://loinc.org" />
<code value="59284-0" />
</coding>
</category>
<patient>
<reference value="Patient/41" />
<display value="John Stifiles" />
</patient>
<policyRule>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/consentpolicycodes" />
<code value="cric" />
</coding>
</policyRule>
<provision>
<type value="deny" />
<period>
<start value="2021-09-27" />
<end value="2021-09-27" />
</period>
</provision>
</Consent>
This is passed with no errors from inferno.healthit.gov/validator/ but when I run through my integrator (it hits HL7 validator), I get a variety of errors - Encountered unknown member 'Scope' or Encountered unknown member 'Patient', etc.

This is a Consent resource that conforms to FHIR version R4. Inferno runs FHIR R4 as well, so that works.
However, if you try and validate this resource against FHIR STU3, you will get the errors you mentioned, since the Consent resource structure significantly changed from STU3 to R4. Please check your integrator and make sure it runs FHIR R4 as well.

Related

How to apply PlanDefinition inorder to generate a carePlan

I am newbie to FHIR. Trying to create careplan by applying PlanDefinition/$apply. Are there any examples available so that I can take them as reference and generate careplan out of planDefintion.
I am able to post an planDefinition but I don't have any clue on implementing $apply out of it.
There is an implementation of PlanDefinition/$apply here:
https://github.com/DBCG/cqf-ruler/blob/master/r4/src/main/java/org/opencds/cqf/r4/providers/PlanDefinitionApplyProvider.java#L84
Note that there is in-progress work on that provider to make it more modular, but the logic is essentially the same.
Have a look at this example from the FHIR Wiki
Request: Apply the low suicide risk order set to patient 124
GET [base]/PlanDefinition/example/$apply?subject=Patient/124
Response: Returned on successful application of the order set
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<CarePlan xmlns="http://hl7.org/fhir">
<!-- This example demonstrates the result of an $apply operation for the citalopramPrescription activity definition. -->
<id value="apply-operation-response"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
Generated...
</div>
</text>
<contained>
<ServiceRequest>
<id value="referralrequest"/>
<status value="draft"/>
<intent value="proposal"/>
<code>
<coding>
<system value="http://snomed.info/sct"/>
<code value="306206005"/>
</coding>
<text value="Referral to service (procedure)"/>
</code>
<subject>
<reference value="Patient/124"/>
</subject>
<occurrenceDateTime value="2017-02-26T11:47:00.000Z"/>
<requester>
<reference value="Practitioner/123"/>
</requester>
<performerType>
<coding>
<system value="http://nucc.org/provider-taxonomy"/>
<code value="261QM0850X"/>
<display value="Adult Mental Health"/>
</coding>
</performerType>
<reasonCode>
<coding>
<system value="http://example.org/CodeSystem/suicide-risk-assessment-score"/>
<code value="Low"/>
<display value="Low Suicide Risk"/>
</coding>
<text value="Low Suicide Risk"/>
</reasonCode>
<reasonReference>
<reference value="RiskAssessment/suicide-risk-assessment"/>
</reasonReference>
</ServiceRequest>
</contained>
<contained>
<Medication>
<id value="citalopramMedication"/>
<code>
<coding>
<system value="http://www.nlm.nih.gov/research/umls/rxnorm"/>
<code value="200371"/>
</coding>
<text value="citalopram"/>
</code>
<form>
<coding>
<system value="http://snomed.info/sct"/>
<code value="385055001"/>
<display value="Tablet dose form"/>
</coding>
<text value="Tablet dose form"/>
</form>
<ingredient>
<itemReference>
<reference value="#citalopramSubstance"/>
</itemReference>
<amount>
<numerator>
<value value="20"/>
<unit value="mg"/>
</numerator>
<denominator>
<value value="1"/>
<unit value="{tbl}"/>
</denominator>
</amount>
</ingredient>
</Medication>
</contained>
<contained>
<Substance>
<id value="citalopramSubstance"/>
<code>
<coding>
<system value="http://www.nlm.nih.gov/research/umls/rxnorm"/>
<code value="2556"/>
</coding>
<text value="citalopram"/>
</code>
</Substance>
</contained>
<contained>
<MedicationRequest>
<id value="citalopramPrescription"/>
<status value="draft"/>
<intent value="proposal"/>
<medicationReference>
<reference value="#citalopramMedication"/>
</medicationReference>
<subject>
<reference value="Patient/124"/>
</subject>
<requester>
<reference value="Practitioner/123"/>
</requester>
<reasonCode>
<coding>
<system value="http://example.org/CodeSystem/suicide-risk-assessment-score"/>
<code value="Low"/>
<display value="Low Suicide Risk"/>
</coding>
<text value="Low Suicide Risk"/>
</reasonCode>
<reasonReference>
<reference value="RiskAssessment/suicide-risk-assessment"/>
</reasonReference>
<!--definition>
<reference value="ActivityDefinition/citalopramPrescription"/>
</definition-->
<instantiates value="ActivityDefinition/citalopramPrescription"/>
<dosageInstruction>
<text value="1 tablet oral 1 time daily"/>
<timing>
<repeat>
<frequency value="1"/>
<period value="1"/>
<periodUnit value="d"/>
</repeat>
</timing>
<route>
<coding>
<code value="26643006"/>
<display value="Oral route (qualifier value)"/>
</coding>
<text value="Oral route (qualifier value)"/>
</route>
<doseAndRate>
<type><text value="ordered"/></type>
<doseQuantity>
<value value="1"/>
<unit value="{tbl}"/>
</doseQuantity>
</doseAndRate>
</dosageInstruction>
<dispenseRequest>
<numberOfRepeatsAllowed value="3"/>
<quantity>
<value value="30"/>
<unit value="{tbl}"/>
</quantity>
</dispenseRequest>
</MedicationRequest>
</contained>
<instantiatesCanonical value="PlanDefinition/example"/>
<status value="draft"/>
<intent value="proposal"/>
<subject>
<reference value="Patient/124"/>
</subject>
<activity>
<reference>
<reference value="#referralrequest"/>
</reference>
</activity>
<activity>
<reference>
<reference value="#citalopramPrescription"/>
</reference>
</activity>
</CarePlan>
I am actively looking for the Plandefinition$apply operation usage or implementation.
as #code tutorial meny

FHIR R4 contained referecnes, schematron validation fails

I am validating the below Appointment resource (which includes a contained reference) using FHIR R4 schema and schmeatron, and I always get this error:
dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource.
From my knowledge the contained reference is well included and referenced, and also the Resource validates against STU 3 schema and schematron, but I am not able to validate against R4 schematron.
What I am doing wrong?
Thanks
<?xml version="1.0" encoding="UTF-8"?>
<Appointment xmlns="http://hl7.org/fhir">
<contained>
<Slot>
<id value="slot159260820191620"/>
<schedule>
<identifier>
<system value="urn:oid:2.16.840.1.113883.3.7482.1.6"/>
<value value="159"/>
</identifier>
</schedule>
<status value="free"/>
<start value="2019-08-26T16:20:00+02:00"/>
<end value="2019-08-26T16:40:00+02:00"/>
</Slot>
</contained>
<status value="proposed"/>
<slot>
<reference value="#slot159260820191620"/>
</slot>
<participant>
<actor>
<identifier>
<system value="urn:oid:2.16.840.1.113883.3.7482.3.1"/>
<value value="143052"/>
</identifier>
</actor>
<status value="accepted"/>
</participant>
Nothing. The schematron is broken. It should say
...for $id in f:contained/*/f:id/#value...
I'll check to confirm whether this is in the list of technical corrections we'll be posting soon.

Multiple referring pratictioners in an FHIR Encounter

I want to express the following use case :
A patient is pregnant. She's seen by two specialists : an endocrinologist and an obstetric gynecologist.
The gynecologist sends her to the hospital, for a care he can't give.
The patient has then :
a family doctor
a referring doctor (obstetric gynecologist)
a specialist (endocrinologist)
The family doctor is referenced in the Patient Resource, by the generalPractitioner element.
But I want to reference the two others practitioners in the Encounter Resource.
I'm ok with the first (the referring), but I don't know where to reference the second.
<?xml version="1.0" encoding="UTF-8"?>
<Encounter xmlns="http://hl7.org/fhir">
<id value="99289910"/>
<contained>
<ReferralRequest>
<id value="p1"/>
<status value="active"/>
<category value="request"/>
<requester>
<reference value="Practitioner/99003499686"/>
<identifier>
<type>
<coding>
<system value="http://hl7.org/fhir/v2/0443"/>
<code value="RP"/>
<display value="Referring Provider"/>
</coding>
<text value="Referring doctor"/>
</type>
<system value='urn:oid:1.2.250.1.71.4.2.1'></system>
<value value='99003499686'/>
<assigner><display value="RPPS"/></assigner>
</identifier>
</requester>
</ReferralRequest>
</contained>
<status value="finished"/>
<class>
<system value="http://hl7.org/fhir/v3/ActCode"/>
<code value="IMP"/>
</class>
<patient>
<reference value="/patient/3803218"/>
</patient>
<incomingReferral>
<reference value="#p1"/>
</incomingReferral>
<period>
<start value="2016-09-07T15:39:00"/>
<end value="2016-09-11T16:35:00"/>
</period>
<location>
<location>
<reference value="/uf/1835"/>
</location>
<status value="completed"/>
<period>
<start value="2016-09-07T15:39:00"/>
<end value="2016-09-08T00:28:00"/>
</period>
</location>
<location>
<location>
<reference value="/uf/3650"/>
</location>
<status value="completed"/>
<period>
<start value="2016-09-08T00:28:00"/>
<end value="2016-09-11T16:35:00"/>
</period>
</location>
<serviceProvider>
<reference value="/uf/2407"/>
</serviceProvider>
</Encounter>
Where can I reference the specialist (endocrinologist) in the Encounter ?
If I understand correctly, the first would be identified as the referring practitioner, but the other is essentially just an "interested party" - someone who should be notified of the admission, the discharge and presumably should receive a copy of the discharge summary.
The concept of "interested party" isn't part of the value set for Encounter.participant.type, but the value set is extensible, so you're free to define your own code for that concept. It seems like a generally useful idea, so I'd encourage you to submit a change request (propose a change link at the bottom of each page in the spec) for us to add that to the specification for everyone.

CRM solution import failed "an item with the same key has already been added"

I have a strange behaviour in one of our CRM-Organizations.
When I export a solution (which only contains the account-entity) as an unmanaged solution it works.
But when I reimport this very same solution without changing anything I get this error
"an item with the same key has already been added".
I found out that I have to remove the Attribute "ownerid" from the solution (and one relationship) and then it works...
this is the attribute
<attribute PhysicalName="OwnerId">
<Type>owner</Type>
<Name>ownerid</Name>
<LogicalName>ownerid</LogicalName>
<RequiredLevel>systemrequired</RequiredLevel>
<DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
<ImeMode>auto</ImeMode>
<ValidForReadApi>1</ValidForReadApi>
<ValidForCreateApi>1</ValidForCreateApi>
<IsCustomField>0</IsCustomField>
<IsAuditEnabled>1</IsAuditEnabled>
<IsSecured>0</IsSecured>
<IntroducedVersion>5.0.0.0</IntroducedVersion>
<SourceType>0</SourceType>
<LookupStyle>single</LookupStyle>
<LookupTypes>
<LookupType id="00000000-0000-0000-0000-000000000000">8</LookupType>
<LookupType id="00000000-0000-0000-0000-000000000000">9</LookupType>
</LookupTypes>
<displaynames>
<displayname description="Vertriebsverantwortlicher" languagecode="1031" />
<displayname description="Owner" languagecode="1033" />
<displayname description="Właściciel" languagecode="1045" />
</displaynames>
<Descriptions>
<Description description="Geben Sie den Benutzer oder das Team ein, der bzw. das mit der Verwaltung des Datensatzes betraut ist. Dieses Feld wird aktualisiert, wenn der Datensatz einem anderen Benutzer zugewiesen wird." languagecode="1031" />
<Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
<Description description="Wprowadź nazwę użytkownika lub zespołu, który zarządza rekordem. To pole jest aktualizowane za każdym razem, gdy rekord zostanie przypisany do innego użytkownika." languagecode="1045" />
</Descriptions>
</attribute>
I also checked the serverlogs and found this:
<importexportxml start="635818108905329459" stop="635818109069971342" progress="22.2222222222222" processed="true">
<solutionManifests>
<solutionManifest languagecode="1031" id="Firma_Transfer" LocalizedName="Firma_Transfer" processed="true">
<UniqueName>Firma_Transfer</UniqueName>
<LocalizedNames>
<LocalizedName description="Firma_Transfer" languagecode="1031" />
</LocalizedNames>
<Descriptions />
<Version>1.0.0</Version>
<Managed>0</Managed>
<Publisher>
<UniqueName>myorg</UniqueName>
<LocalizedNames>
<LocalizedName description="Myorg" languagecode="1031" />
</LocalizedNames>
<Descriptions />
<EMailAddress />
<SupportingWebsiteUrl />
<Addresses>
<Address>
<City />
<Country />
<Line1 />
<Line2 />
<PostalCode />
<StateOrProvince />
<Telephone1 />
</Address>
</Addresses>
</Publisher>
<results />
<result result="success" errorcode="0" errortext="" datetime="13:08:12.07" datetimeticks="635818072920798192" />
</solutionManifest>
</solutionManifests>
<upgradeSolutionPackageInformation>
<upgradeRequired>0</upgradeRequired>
<upgradeValid>1</upgradeValid>
<fileVersion>7.0.1.129</fileVersion>
<currentVersion>7.0.1.129</currentVersion>
<fileSku>OnPremise</fileSku>
<currentSku>OnPremise</currentSku>
</upgradeSolutionPackageInformation>
<entities>
<entity LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="true">
<result result="failure" errorcode="0x80044150" errortext="Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt." datetime="13:08:26.96" datetimeticks="635818073069658863" />
</entity>
</entities>
<nodes />
<settings />
<dashboards />
<securityroles />
<workflows />
<templates />
<optionSets />
<ConnectionRoles />
<SolutionPluginAssemblies />
<SdkMessageProcessingSteps />
<ServiceEndpoints />
<webResources />
<reports />
<FieldSecurityProfiles />
<convertrules />
<routingrules />
<Slas />
<languages>
<language>
<result result="success" errorcode="0" errortext="" datetime="13:08:11.07" datetimeticks="635818072910798185" />
</language>
</languages>
<entitySubhandlers>
<savedQuery LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false"/>
<formXml LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false">
</formXml>
<entityCustomResources LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false"/>
<entityRibbon LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false"/>
<savedQueryVisualization LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false">
</savedQueryVisualization>
</entitySubhandlers>
<rootComponents>
<rootComponent processed="false" />
</rootComponents>
<dependencies>
<dependency processed="false" />
</dependencies>
All I found in the internet pointed to an problem with an attribute (missmatching type, ...) but in my case this is the same organization and no transfer from dev to prod or something like that...
We are using CRM 2015 but we had this problem in 2011 already.
Has anybody a solution for this? we don't want to edit the customization.XML everytime before importing a solution...
this is the database-field
[OwnerId] [uniqueidentifier] NOT NULL CONSTRAINT [DF_AccountBase_OwnerId] DEFAULT ('00000000-0000-0000-0000-000000000000')
thanks
Tobias
Your database field for OwnerId looks fine. Delete any custom fields with common names from your destination organization and try the import again. For instance, if you have new_LastEmailDate on both, or any custom field that performs the same function as a custom field in the solution, delete it from the destination. One of your custom fields is being recognized as a new addition of an existing field, probably due to capitalization. If you're writing it in from the new solution, you don't need it in the destination anyway and a non-conflicting copy will be replaced.
This happens for me when I try to reinstall a CRM 2016 Outlook that has been offline with a previous version of CRM. Uninstalling CRM and SQL server related items, cleaning up the registry deleting all folder and files related to the installation. I think it's worth mentioning that the installations works against the same CRM environment on other PC's.
The error you are seeing is very generic, but the fact that you know which attribute is causing the issue makes things a lot easier. It is usually possible to fix this type of issue by making direct database changes to repair corrupted metadata (unsupported!), but it requires a SQL developer with decent knowledge of how the CRM metadata tables work. If you have such a person I could provide additional guidance, otherwise you should create a case with Microsoft.

Can a FHIR extension be defined within the StructureDefinition of a profiled resource?

Does a FHIR extension always have to be defined in its own StructureDefinition before it can be used in a resource profile?
Or can its definition exist solely within the StructureDefinition of a profiled resource?
E.g.
<StructureDefinition xmlns="http://hl7.org/fhir">
<base value="http://hl7.org/fhir/StructureDefinition/Order" />
<name value="Order" />
...
<differential>
<element>
<path value="Order.extension" />
<name value="type" />
<label value="Type" />
<short value="BookAppointment | TelephonePatient | PatientNote | Note | Other" />
<definition value="Order type" />
<min value="1" />
<max value="1" />
<type>
<code value="code" />
</type>
<binding>
<strength value="required" />
<valueSetReference>
<reference value="http://test.org/fhir/ValueSet/task-type" />
</valueSetReference>
</binding>
</element>
...
Is the above valid?
No, that's not valid - because Order.extension can't have a type of "code". You could, in theory, slice extension and constrain the value[x] type to be valueCode with the specified properties. You'd also have to constrain the URL to a specified fixed value. The tricky part is that the URL you indicate as the fixed value is supposed to resolve to a StructureDefinition that defines the extension. So you really won't have saved yourself any work. Sending an instance where any immediate receiver can't discover the extension definition would make you automatically non-conformant.

Resources