Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation does not handle nullfavours correctly. #1253

Open
2 tasks done
SevKohler opened this issue Feb 22, 2024 · 0 comments
Open
2 tasks done

Validation does not handle nullfavours correctly. #1253

SevKohler opened this issue Feb 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SevKohler
Copy link

SevKohler commented Feb 22, 2024

Before reporting an issue

  • I have searched existing issues
  • I have reproduced the issue with the latest release

Environment information

ehrbase next
openEHR_SDK newest
Generator version used for composition: 0.18.0

Steps to reproduce

send json to ehrbase

Expected behavior

Validates successfully

Actual result

Demands Zeitpunkt der Probenentnahme, even thou it is provided as nullflavour.
Same goes for Zugehörige Laborprobe.

"Error occurred while merging composition in EHRbase: Wrong Status code. Expected: [200, 201, 204]. Got: 422. Error message: {"error":"Unprocessable Entity","message":"/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1 and name/value='Befund']/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.specimen.v1]/items[at0015]/value: Attribute has 0 occurrences, but must be 1..1, /content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1 and name/value='Befund']/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v0 and name/value='Kultur']/items[openEHR-EHR-CLUSTER.laboratory_test_analyte.v1 and name/value='Pro Erreger']/items[at0026 and name/value='Zugehörige Laborprobe']/value: Attribute has 0 occurrences, but must be 1..1, /content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1 and name/value='Befund']/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v0 and name/value='Kultur']/items[openEHR-EHR-CLUSTER.laboratory_test_analyte.v1 and name/value='Pro Erreger']/items[at0026 and name/value='Zugehörige Laborprobe']/value: Attribute has 0 occurrences, but must be 1..1"}"

Further information

JSON

Template:
https://ckm.highmed.org/ckm/templates/1246.169.69

{
  "_type" : "COMPOSITION",
  "name" : {
    "_type" : "DV_TEXT",
    "value" : "Mikrobiologischer Befund"
  },
  "archetype_details" : {
    "archetype_id" : {
      "value" : "openEHR-EHR-COMPOSITION.report-result.v1"
    },
    "template_id" : {
      "value" : "Mikrobiologischer Befund"
    },
    "rm_version" : "1.0.4"
  },
  "feeder_audit" : {
    "_type" : "FEEDER_AUDIT",
    "originating_system_item_ids" : [ {
      "_type" : "DV_IDENTIFIER",
      "id" : "Observation/48f361c9-4c15-470f-8f5c-b7f135a80c5e/_history/1",
      "type" : "fhir_logical_id"
    }, {
      "_type" : "DV_IDENTIFIER",
      "assigner" : "fhir_patient_id",
      "id" : "Patient/b8b51951-4b57-4b5a-a1c7-56c52f8fbd5d/_history/1"
    }, {
      "_type" : "DV_IDENTIFIER",
      "id" : "07f602e0-579e-4fe3-95af-381728bf0d49",
      "type" : "fhir_patient_identifier"
    } ],
    "originating_system_audit" : {
      "_type" : "FEEDER_AUDIT_DETAILS",
      "system_id" : "FHIR-Bridge"
    }
  },
  "language" : {
    "_type" : "CODE_PHRASE",
    "terminology_id" : {
      "_type" : "TERMINOLOGY_ID",
      "value" : "ISO_639-1"
    },
    "code_string" : "de"
  },
  "territory" : {
    "_type" : "CODE_PHRASE",
    "terminology_id" : {
      "_type" : "TERMINOLOGY_ID",
      "value" : "ISO_3166-1"
    },
    "code_string" : "DE"
  },
  "category" : {
    "_type" : "DV_CODED_TEXT",
    "value" : "event",
    "defining_code" : {
      "_type" : "CODE_PHRASE",
      "terminology_id" : {
        "_type" : "TERMINOLOGY_ID",
        "value" : "openehr"
      },
      "code_string" : "433"
    }
  },
  "composer" : {
    "_type" : "PARTY_IDENTIFIED",
    "identifiers" : [ {
      "_type" : "DV_IDENTIFIER",
      "assigner" : "https://www.medizininformatik-initiative.de/fhir/core/CodeSystem/core-location-identifiers",
      "id" : "Charité"
    } ]
  },
  "context" : {
    "_type" : "EVENT_CONTEXT",
    "start_time" : {
      "_type" : "DV_DATE_TIME",
      "value" : "2018-11-20T12:05:00.000+01:00"
    },
    "setting" : {
      "_type" : "DV_CODED_TEXT",
      "value" : "secondary medical care",
      "defining_code" : {
        "_type" : "CODE_PHRASE",
        "terminology_id" : {
          "_type" : "TERMINOLOGY_ID",
          "value" : "openehr"
        },
        "code_string" : "232"
      }
    },
    "other_context" : {
      "_type" : "ITEM_TREE",
      "name" : {
        "_type" : "DV_TEXT",
        "value" : "Tree"
      },
      "items" : [ {
        "_type" : "ELEMENT",
        "name" : {
          "_type" : "DV_TEXT",
          "value" : "Bericht ID"
        },
        "value" : {
          "_type" : "DV_TEXT",
          "value" : "59826-8_1234567890"
        },
        "archetype_node_id" : "at0002"
      }, {
        "_type" : "ELEMENT",
        "name" : {
          "_type" : "DV_TEXT",
          "value" : "Status"
        },
        "value" : {
          "_type" : "DV_TEXT",
          "value" : "Endbefund"
        },
        "archetype_node_id" : "at0005"
      }, {
        "_type" : "CLUSTER",
        "name" : {
          "_type" : "DV_TEXT",
          "value" : "Fallidentifikation"
        },
        "archetype_details" : {
          "archetype_id" : {
            "value" : "openEHR-EHR-CLUSTER.case_identification.v0"
          },
          "template_id" : {
            "value" : "Mikrobiologischer Befund"
          },
          "rm_version" : "1.0.4"
        },
        "items" : [ {
          "_type" : "ELEMENT",
          "name" : {
            "_type" : "DV_TEXT",
            "value" : "Fall-Kennung"
          },
          "value" : {
            "_type" : "DV_TEXT",
            "value" : "F_0000001"
          },
          "archetype_node_id" : "at0001"
        } ],
        "archetype_node_id" : "openEHR-EHR-CLUSTER.case_identification.v0"
      } ],
      "archetype_node_id" : "at0001"
    }
  },
  "content" : [ {
    "_type" : "OBSERVATION",
    "name" : {
      "_type" : "DV_TEXT",
      "value" : "Befund"
    },
    "archetype_details" : {
      "archetype_id" : {
        "value" : "openEHR-EHR-OBSERVATION.laboratory_test_result.v1"
      },
      "template_id" : {
        "value" : "Mikrobiologischer Befund"
      },
      "rm_version" : "1.0.4"
    },
    "language" : {
      "_type" : "CODE_PHRASE",
      "terminology_id" : {
        "_type" : "TERMINOLOGY_ID",
        "value" : "ISO_639-1"
      },
      "code_string" : "de"
    },
    "encoding" : {
      "_type" : "CODE_PHRASE",
      "terminology_id" : {
        "_type" : "TERMINOLOGY_ID",
        "value" : "IANA_character-sets"
      },
      "code_string" : "UTF-8"
    },
    "subject" : {
      "_type" : "PARTY_SELF"
    },
    "data" : {
      "name" : {
        "_type" : "DV_TEXT",
        "value" : "Event Series"
      },
      "origin" : {
        "_type" : "DV_DATE_TIME",
        "value" : "2018-11-20T12:05:00.000+01:00"
      },
      "events" : [ {
        "_type" : "POINT_EVENT",
        "name" : {
          "_type" : "DV_TEXT",
          "value" : "Jedes Ereignis"
        },
        "time" : {
          "_type" : "DV_DATE_TIME",
          "value" : "2018-11-20T12:05:00.000+01:00"
        },
        "data" : {
          "_type" : "ITEM_TREE",
          "name" : {
            "_type" : "DV_TEXT",
            "value" : "Tree"
          },
          "items" : [ {
            "_type" : "ELEMENT",
            "name" : {
              "_type" : "DV_TEXT",
              "value" : "Labortest-Bezeichnung"
            },
            "value" : {
              "_type" : "DV_CODED_TEXT",
              "value" : "Microbiology studies",
              "defining_code" : {
                "_type" : "CODE_PHRASE",
                "terminology_id" : {
                  "_type" : "TERMINOLOGY_ID",
                  "value" : "LOINC"
                },
                "code_string" : "18725-2"
              }
            },
            "archetype_node_id" : "at0005"
          }, {
            "_type" : "CLUSTER",
            "name" : {
              "_type" : "DV_TEXT",
              "value" : "Probe"
            },
            "archetype_details" : {
              "archetype_id" : {
                "value" : "openEHR-EHR-CLUSTER.specimen.v1"
              },
              "template_id" : {
                "value" : "Mikrobiologischer Befund"
              },
              "rm_version" : "1.0.4"
            },
            "items" : [ {
              "_type" : "ELEMENT",
              "name" : {
                "_type" : "DV_TEXT",
                "value" : "Probenart"
              },
              "null_flavour" : {
                "_type" : "DV_CODED_TEXT",
                "value" : "no information",
                "defining_code" : {
                  "_type" : "CODE_PHRASE",
                  "terminology_id" : {
                    "_type" : "TERMINOLOGY_ID",
                    "value" : "openehr"
                  },
                  "code_string" : "271"
                }
              },
              "archetype_node_id" : "at0029"
            }, {
              "_type" : "ELEMENT",
              "name" : {
                "_type" : "DV_TEXT",
                "value" : "Laborprobenidentifikator"
              },
              "null_flavour" : {
                "_type" : "DV_CODED_TEXT",
                "value" : "no information",
                "defining_code" : {
                  "_type" : "CODE_PHRASE",
                  "terminology_id" : {
                    "_type" : "TERMINOLOGY_ID",
                    "value" : "openehr"
                  },
                  "code_string" : "271"
                }
              },
              "archetype_node_id" : "at0001"
            }, {
              "_type" : "ELEMENT",
              "name" : {
                "_type" : "DV_TEXT",
                "value" : "Zeitpunkt des Probeneingangs"
              },
              "null_flavour" : {
                "_type" : "DV_CODED_TEXT",
                "value" : "no information",
                "defining_code" : {
                  "_type" : "CODE_PHRASE",
                  "terminology_id" : {
                    "_type" : "TERMINOLOGY_ID",
                    "value" : "openehr"
                  },
                  "code_string" : "271"
                }
              },
              "archetype_node_id" : "at0034"
            }, {
              "_type" : "ELEMENT",
              "name" : {
                "_type" : "DV_TEXT",
                "value" : "Zeitpunkt der Probenentnahme"
              },
              "null_flavour" : {
                "_type" : "DV_CODED_TEXT",
                "value" : "no information",
                "defining_code" : {
                  "_type" : "CODE_PHRASE",
                  "terminology_id" : {
                    "_type" : "TERMINOLOGY_ID",
                    "value" : "openehr"
                  },
                  "code_string" : "271"
                }
              },
              "archetype_node_id" : "at0015"
            } ],
            "archetype_node_id" : "openEHR-EHR-CLUSTER.specimen.v1"
          }, {
            "_type" : "CLUSTER",
            "name" : {
              "_type" : "DV_TEXT",
              "value" : "Kultur"
            },
            "archetype_details" : {
              "archetype_id" : {
                "value" : "openEHR-EHR-CLUSTER.laboratory_test_panel.v0"
              },
              "template_id" : {
                "value" : "Mikrobiologischer Befund"
              },
              "rm_version" : "1.0.4"
            },
            "items" : [ {
              "_type" : "CLUSTER",
              "name" : {
                "_type" : "DV_TEXT",
                "value" : "Pro Erreger"
              },
              "archetype_details" : {
                "archetype_id" : {
                  "value" : "openEHR-EHR-CLUSTER.laboratory_test_analyte.v1"
                },
                "template_id" : {
                  "value" : "Mikrobiologischer Befund"
                },
                "rm_version" : "1.0.4"
              },
              "items" : [ {
                "_type" : "ELEMENT",
                "name" : {
                  "_type" : "DV_TEXT",
                  "value" : "Nachweis"
                },
                "value" : {
                  "_type" : "DV_TEXT",
                  "value" : "Nachweis"
                },
                "archetype_node_id" : "at0024"
              }, {
                "_type" : "ELEMENT",
                "name" : {
                  "_type" : "DV_TEXT",
                  "value" : "Erregername"
                },
                "value" : {
                  "_type" : "DV_CODED_TEXT",
                  "value" : "Severe acute respiratory syndrome coronavirus 2 (organism)",
                  "defining_code" : {
                    "_type" : "CODE_PHRASE",
                    "terminology_id" : {
                      "_type" : "TERMINOLOGY_ID",
                      "value" : "http://snomed.info/sct"
                    },
                    "code_string" : "840533007"
                  }
                },
                "archetype_node_id" : "at0001"
              }, {
                "_type" : "CLUSTER",
                "name" : {
                  "_type" : "DV_TEXT",
                  "value" : "Erregerdetails"
                },
                "archetype_details" : {
                  "archetype_id" : {
                    "value" : "openEHR-EHR-CLUSTER.erregerdetails.v1"
                  },
                  "template_id" : {
                    "value" : "Mikrobiologischer Befund"
                  },
                  "rm_version" : "1.0.4"
                },
                "items" : [ {
                  "_type" : "CLUSTER",
                  "name" : {
                    "_type" : "DV_TEXT",
                    "value" : "Antibiogramm"
                  },
                  "archetype_details" : {
                    "archetype_id" : {
                      "value" : "openEHR-EHR-CLUSTER.laboratory_test_panel.v0"
                    },
                    "template_id" : {
                      "value" : "Mikrobiologischer Befund"
                    },
                    "rm_version" : "1.0.4"
                  },
                  "items" : [ {
                    "_type" : "CLUSTER",
                    "name" : {
                      "_type" : "DV_TEXT",
                      "value" : "Pro Antibiotikum"
                    },
                    "archetype_details" : {
                      "archetype_id" : {
                        "value" : "openEHR-EHR-CLUSTER.laboratory_test_analyte.v1"
                      },
                      "template_id" : {
                        "value" : "Mikrobiologischer Befund"
                      },
                      "rm_version" : "1.0.4"
                    },
                    "items" : [ {
                      "_type" : "ELEMENT",
                      "name" : {
                        "_type" : "DV_TEXT",
                        "value" : "Antibiotikum"
                      },
                      "value" : {
                        "_type" : "DV_CODED_TEXT",
                        "value" : "Aztreonam [Susceptibility]",
                        "defining_code" : {
                          "_type" : "CODE_PHRASE",
                          "terminology_id" : {
                            "_type" : "TERMINOLOGY_ID",
                            "value" : "http://loinc.org"
                          },
                          "code_string" : "18868-0"
                        }
                      },
                      "archetype_node_id" : "at0024"
                    }, {
                      "_type" : "ELEMENT",
                      "name" : {
                        "_type" : "DV_TEXT",
                        "value" : "Minimale Hemmkonzentration"
                      },
                      "value" : {
                        "_type" : "DV_QUANTITY",
                        "units" : "mg/L",
                        "magnitude" : 32.0
                      },
                      "archetype_node_id" : "at0001"
                    }, {
                      "_type" : "ELEMENT",
                      "name" : {
                        "_type" : "DV_TEXT",
                        "value" : "Resistenz"
                      },
                      "value" : {
                        "_type" : "DV_CODED_TEXT",
                        "value" : "Susceptible, standard dosing regimen",
                        "defining_code" : {
                          "_type" : "CODE_PHRASE",
                          "terminology_id" : {
                            "_type" : "TERMINOLOGY_ID",
                            "value" : "http://highmed.org/fhir/CodeSystem/ic/resistenzklassen-antibiogramm-eucast"
                          },
                          "code_string" : "Susceptible, standard dosing regimen"
                        }
                      },
                      "archetype_node_id" : "at0004"
                    } ],
                    "archetype_node_id" : "openEHR-EHR-CLUSTER.laboratory_test_analyte.v1"
                  } ],
                  "archetype_node_id" : "openEHR-EHR-CLUSTER.laboratory_test_panel.v0"
                }, {
                  "_type" : "ELEMENT",
                  "name" : {
                    "_type" : "DV_TEXT",
                    "value" : "MRE Klasse"
                  },
                  "value" : {
                    "_type" : "DV_CODED_TEXT",
                    "value" : "3MRGN",
                    "defining_code" : {
                      "_type" : "CODE_PHRASE",
                      "terminology_id" : {
                        "_type" : "TERMINOLOGY_ID",
                        "value" : "http://highmed.org/fhir/CodeSystem/ic/mre-klassen-lokal"
                      },
                      "code_string" : "3MRGN"
                    }
                  },
                  "archetype_node_id" : "at0018"
                } ],
                "archetype_node_id" : "openEHR-EHR-CLUSTER.erregerdetails.v1"
              }, {
                "_type" : "ELEMENT",
                "name" : {
                  "_type" : "DV_TEXT",
                  "value" : "Zugehörige Laborprobe"
                },
                "null_flavour" : {
                  "_type" : "DV_CODED_TEXT",
                  "value" : "unknown",
                  "defining_code" : {
                    "_type" : "CODE_PHRASE",
                    "terminology_id" : {
                      "_type" : "TERMINOLOGY_ID",
                      "value" : "openehr"
                    },
                    "code_string" : "253"
                  }
                },
                "archetype_node_id" : "at0026"
              } ],
              "archetype_node_id" : "openEHR-EHR-CLUSTER.laboratory_test_analyte.v1"
            } ],
            "archetype_node_id" : "openEHR-EHR-CLUSTER.laboratory_test_panel.v0"
          } ],
          "archetype_node_id" : "at0003"
        },
        "archetype_node_id" : "at0002"
      } ],
      "archetype_node_id" : "at0001"
    },
    "archetype_node_id" : "openEHR-EHR-OBSERVATION.laboratory_test_result.v1"
  } ],
  "archetype_node_id" : "openEHR-EHR-COMPOSITION.report-result.v1"
}
@SevKohler SevKohler added the bug Something isn't working label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant