We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When marshaling then unmarshaling Observations we are encountering the following error
"unknown QuantityComparator code `\u003c`"
It appears that this is to do with how the UnmarshalJSON function is implemented for the QuantityComparator
the UnmarshalJSON
QuantityComparator
Its seems that simply stringing the quantity comparator doesnt properly convert \u003c into < and instead the code would need to use json.Unmarshall?
\u003c
<
https://github.com/samply/golang-fhir-models/blob/master/fhir-models/fhir/quantityComparator.go#L40
Example:
package observationtest import ( "encoding/json" "github.com/samply/golang-fhir-models/fhir-models/fhir" "testing" ) func Test_observation_marshalling(t *testing.T) { id := "123" snomed := "snomed" code := "456" lessThan := fhir.QuantityComparatorLessThan o := fhir.Observation{ Id: &id, Status: fhir.ObservationStatusPreliminary, Code: fhir.CodeableConcept{ Coding: []fhir.Coding{ { System: &snomed, Code: &code, }, }, }, ValueQuantity: &fhir.Quantity{ Comparator: &lessThan, }, } b, err := json.Marshal(o) if err != nil { panic(err) } var observationUnmarshalled fhir.Observation err = json.Unmarshal(b, &observationUnmarshalled) if err != nil { panic(err) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When marshaling then unmarshaling Observations we are encountering the following error
"unknown QuantityComparator code `\u003c`"
It appears that this is to do with how
the UnmarshalJSON
function is implemented for theQuantityComparator
Its seems that simply stringing the quantity comparator doesnt properly convert
\u003c
into<
and instead the code would need to use json.Unmarshall?https://github.com/samply/golang-fhir-models/blob/master/fhir-models/fhir/quantityComparator.go#L40
Example:
The text was updated successfully, but these errors were encountered: