trifork / klg-docs

Public documentation for Gateway
0 stars 8 forks source link

Documentation confusion Encounter.type.coding vs Encounter.type.coding.code #24

Closed LindaLawton closed 2 years ago

LindaLawton commented 2 years ago

Resource Profile: CareEncounter

If we read first this part.

It is important in FSIII to be able to express follow-up encounters. In the planning state, these are documented by setting Encounter.status = “planned”, and Encounter.type.coding = “opfølgning”. When a followUp has been performed, the Encounter.status is changed to “finished”.

Then we check the model.

image

Not only does the model not match Encounter.type.coding but type.coding.code is a fixed value.

jkiddo commented 2 years ago

Planning state:

Encounter.status = 'planned'
Encounter.type.coding.code = '9f03dfbb-7a97-45a5-94db-d4c3501714a9'

Follow-up:

Encounter.status = 'finished'
Encounter.type.coding.code = '9f03dfbb-7a97-45a5-94db-d4c3501714a9'

Wherein lies the confusion?

LindaLawton commented 2 years ago

I am sorry that I was not clear as to the cause of the confusion, I will try to explain better. We are in the process of redoing our extraction and are going though the model in detail to ensure that we are sending the proper values that is when we spotted this discrepancy.

There is a difference between an string and an object in C#. The text describes a string and the json model describes the same values as that of an object.

Example:

The first one Encounter.type.coding = “opfølgning” has a value that is a string.

Yet the object structure shows type to be a type of CodeableConcept object. So Encounter.type.coding is an object.

Even in your example you are setting it to Encoutner.type.coding.code which is again an object and you are not setting Encounter.type.coding = “opfølgning” to a string. Which is what the text in the documentation says we should be sending when the status is planed.

I didn't ask anything about status as its not related my question is with the statement how to set an object of Encounter.type.coding which appears to have a static for code within that object 9f03dfbb-7a97-45a5-94db-d4c3501714a9 to a string of “opfølgning" which is again not an object but a string and a Danish would at that.

The only thing i can think of is that the model changes when it has a status of planed and Encounter.type.coding is a string then and not an object. Can you verify this?

jkiddo commented 2 years ago

Consider the following as pseudo code

Encounter.status = 'finished'
Encounter.type.coding.code = '9f03dfbb-7a97-45a5-94db-d4c3501714a9'

For datatype binding questions specific for the language C# please refer to eg. https://www.nuget.org/packages/Hl7.Fhir.R4

LindaLawton commented 2 years ago

Consider this line.

Encounter.type.coding = “opfølgning”

How do I set

Encounter.type.coding equal to a string.

We are following the guidelines defined for this this project eg. Resource Profile: CareEncounter Please refer to the model shown there. I need to follow this SPEC.

jkiddo commented 2 years ago

Looking at https://build.fhir.org/ig/hl7dk/kl-gateway/Encounter-bfa70a76-318d-453d-9abc-76982f8d13ca.json.html - which is


{
  "resourceType": "Encounter",
  "id": "bfa70a76-318d-453d-9abc-76982f8d13ca",
  "meta": {
    "profile": [
      "http://gateway.kl.dk/1.0/StructureDefinition/klgateway-care-encounter"
    ]
  },
  "status": "planned",
  "class": {
    "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
    "code": "HH"
  },
  "type": [
    {
      "coding": [
        {
          "system": "http://kl.dk/fhir/common/caresocial/CodeSystem/KLCommonCareSocialCodes",
          "code": "9f03dfbb-7a97-45a5-94db-d4c3501714a9"
        }
      ]
    }
  ],
  "subject": {
    "reference": "Patient/TestPerson"
  },
  "period": {
    "start": "2020-08-14"
  }
}

-the Encounter.type.coding.code 9f03dfbb-7a97-45a5-94db-d4c3501714a9 is bound to the social codes here: https://build.fhir.org/ig/hl7dk/KL-dk//CodeSystem-KLCommonCareSocialCodes.html - where you can see that 9f03dfbb-7a97-45a5-94db-d4c3501714a9 translates to "opfølgning". Meaning: you set the coded value, not the text.

LindaLawton commented 2 years ago

where you can see that 9f03dfbb-7a97-45a5-94db-d4c3501714a9 translates to "opfølgning".

So the text is an error and the json is correct? Thank you that's all I needed verified.