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

Incompatibility with DURATION field for YEAR and MONTHS #1220

Open
2 tasks done
johnmeredith opened this issue Nov 30, 2023 · 3 comments
Open
2 tasks done

Incompatibility with DURATION field for YEAR and MONTHS #1220

johnmeredith opened this issue Nov 30, 2023 · 3 comments

Comments

@johnmeredith
Copy link

Before reporting an issue

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

Environment information

<status>
    <ehrbase_version>0.24.0-SNAPSHOT</ehrbase_version>
    <openehr_sdk_version>1.24.0-SNAPSHOT</openehr_sdk_version>
    <archie_version>2.0.1</archie_version>
    <jvm_version>Eclipse Adoptium 17.0.5+8</jvm_version>
    <os_version>Linux amd64 5.19.0-46-generic</os_version>
    <postgres_version>PostgreSQL 13.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit</postgres_version>
</status>

Steps to reproduce

Commit:

"rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age/duration_value": "P2Y2M",

Expected behavior

Successful commit.

Actual result

{
"error": "Bad Request",
"message": "Could not consume Parts [rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age/duration_value]"
}

Further information

Template is configured with a duration field to capture years and months only. There seems to be an incompatibility here. Successfully commits with Better CDR.
rcpch-growth-chart.v0.opt.zip

Example composition:

{
    "rcpch_growth_chart_calculation/language|code": "en",
    "rcpch_growth_chart_calculation/territory|code": "GB",
    "rcpch_growth_chart_calculation/composer|name": "Silvia Blake",
    "rcpch_growth_chart_calculation/context/_participation:0|function": "requester",
    "rcpch_growth_chart_calculation/context/_participation:0|mode": "face-to-face communication",
    "rcpch_growth_chart_calculation/context/_participation:0|id": "199",
    "rcpch_growth_chart_calculation/context/_participation:0|name": "Lara Markham",
    "rcpch_growth_chart_calculation/context/_participation:1|function": "performer",
    "rcpch_growth_chart_calculation/context/_participation:1|mode": "face-to-face communication",
    "rcpch_growth_chart_calculation/context/_participation:1|id": "198",
    "rcpch_growth_chart_calculation/context/_participation:1|name": "Billy Williamson",
    "rcpch_growth_chart_calculation/context/_health_care_facility|id": "7A5B1",
    "rcpch_growth_chart_calculation/context/_health_care_facility|id_scheme": "2.16.840.1.113883.2.1.4.3",
    "rcpch_growth_chart_calculation/context/_health_care_facility|id_namespace": "wales.nhs.uk",
    "rcpch_growth_chart_calculation/context/_health_care_facility|name": "Royal Glamorgan Hospital",
    "rcpch_growth_chart_calculation/context/report_id": "Report ID 32",
    "rcpch_growth_chart_calculation/context/status": "Final",
    "rcpch_growth_chart_calculation/_feeder_audit/originating_system_audit|system_id": "RCPCH_API",
    "rcpch_growth_chart_calculation/_feeder_audit/original_content": "eyJiaXJ0aF9kYXRhIjp7ImJpcnRoX2RhdGUiOiIyMDIwLTA0LTEyIiwiZ2VzdGF0aW9uX3dlZWtzIjo0MCwiZ2VzdGF0aW9uX2RheXMiOjAsImVzdGltYXRlZF9kYXRlX2RlbGl2ZXJ5IjoiMjAyMC0wNC0xMiIsImVzdGltYXRlZF9kYXRlX2RlbGl2ZXJ5X3N0cmluZyI6IlN1biAxMiBBcHJpbCwgMjAyMCIsInNleCI6ImZlbWFsZSJ9LCJtZWFzdXJlbWVudF9kYXRlcyI6eyJvYnNlcnZhdGlvbl9kYXRlIjoiMjAyOC0wNi0xMiIsImNocm9ub2xvZ2ljYWxfZGVjaW1hbF9hZ2UiOjguMTY3MDA4ODk4MDE1MDU5LCJjb3JyZWN0ZWRfZGVjaW1hbF9hZ2UiOjguMTY3MDA4ODk4MDE1MDU5LCJjaHJvbm9sb2dpY2FsX2NhbGVuZGFyX2FnZSI6IjggeWVhcnMgYW5kIDIgbW9udGhzIiwiY29ycmVjdGVkX2NhbGVuZGFyX2FnZSI6IjggeWVhcnMgYW5kIDIgbW9udGhzIiwiY29ycmVjdGVkX2d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joiZ3JldWxpY2gtcHlsZSIsImJvbmVfYWdlX3NkcyI6Mi4wLCJib25lX2FnZV9jZW50aWxlIjo5OC4wLCJib25lX2FnZV90ZXh0IjoiVGhpcyBib25lIGFnZSBpcyBhZHZhbmNlZCJ9LCJldmVudHNfZGF0YSI6eyJldmVudHNfdGV4dCI6WyJHcm93dGggaG9ybW9uZSBzdGFydCIsIkdyb3d0aCBIb3Jtb25lIERlZmljaWVuY3kgZGlhZ25vc2lzIl19fQ==",
    "rcpch_growth_chart_calculation/_feeder_audit/original_content|formalism": "application/js64",
    "rcpch_growth_chart_calculation/child_data/birth_summary/birth_date": "2023-10-27",
    "rcpch_growth_chart_calculation/child_data/birth_summary/birth_detail/gestation": "P22W2D",
    "rcpch_growth_chart_calculation/child_data/birth_summary/comment": "Comment 42",
    "rcpch_growth_chart_calculation/child_data/birth_summary/last_updated": "2023-10-27T13:11:27.515Z",
    "rcpch_growth_chart_calculation/child_data/gender/sex_assigned_at_birth": "Sex assigned at birth 5",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age/duration_value": "P2Y2M",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_text": "Bone age text 87",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_centile|numerator": 31.81,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_centile|denominator": 100.0,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_centile|type": 2,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_sds|magnitude": 98.4,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_sds|unit": "1",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/event_text": "Event text 42",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/bone_age_type": "fels",
    "rcpch_growth_chart_calculation/measurement_data/age/chronological_age": "P3Y3M1W1D",
    "rcpch_growth_chart_calculation/measurement_data/age/corrected_age": "P4M2W3D",
    "rcpch_growth_chart_calculation/measurement_data/age/comment": "Comment 91",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/growth_indicator|code": "at0020",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/uri_to_original_measurement": "https://cdr.code4health.org/rest/v1/composition/bf6a4713-2544-46e4-8dc7-ec38b73eba6c::7815d0e1-7902-453c-835a-f2a57c5dfe57::1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile|numerator": 19.43,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile|denominator": 100.0,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile|type": 2,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/sds|magnitude": 85.32,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/sds|unit": "1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile_band": "Centile band 77",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/growth_indicator|code": "at0020",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/uri_to_original_measurement": "https://cdr.code4health.org/rest/v1/composition/bf6a4713-2544-46e4-8dc7-ec38b73eba6c::7815d0e1-7902-453c-835a-f2a57c5dfe57::1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile|numerator": 54.76,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile|denominator": 100.0,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile|type": 2,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/sds|magnitude": 96.74,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/sds|unit": "1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile_band": "Centile band 71",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content": "http://med.tube.com/sample",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content|mediatype": "video/mp4",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content|alternatetext": "alternate text",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content|size": 504903212,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content_name": "Imported RCHPH results"
}
@johnmeredith johnmeredith added the bug Something isn't working label Nov 30, 2023
@stefanspiska
Copy link
Contributor

@johnmeredith

The following Flat json can be saved

{
    
	  "ctx/language": "en",
    "ctx/territory": "GB",
    "rcpch_growth_chart_calculation/composer|name": "Silvia Blake",
    "rcpch_growth_chart_calculation/context/_participation:0|function": "requester",
    "rcpch_growth_chart_calculation/context/_participation:0|mode": "face-to-face communication",
    "rcpch_growth_chart_calculation/context/_participation:0|id": "199",
	   "rcpch_growth_chart_calculation/context/_participation:0|id_scheme": "id_scheme",
		  "rcpch_growth_chart_calculation/context/_participation:0|id_namespace": "id_namespace",
    "rcpch_growth_chart_calculation/context/_participation:0|name": "Lara Markham",
    "rcpch_growth_chart_calculation/context/_participation:1|function": "performer",
    "rcpch_growth_chart_calculation/context/_participation:1|mode": "face-to-face communication",
    "rcpch_growth_chart_calculation/context/_participation:1|id": "198",
	    "rcpch_growth_chart_calculation/context/_participation:1|id_scheme": "id_scheme",
			  "rcpch_growth_chart_calculation/context/_participation:1|id_namespace": "id_namespace",
    "rcpch_growth_chart_calculation/context/_participation:1|name": "Billy Williamson",
    "rcpch_growth_chart_calculation/context/_health_care_facility|id": "7A5B1",
    "rcpch_growth_chart_calculation/context/_health_care_facility|id_scheme": "2.16.840.1.113883.2.1.4.3",
    "rcpch_growth_chart_calculation/context/_health_care_facility|id_namespace": "wales.nhs.uk",
    "rcpch_growth_chart_calculation/context/_health_care_facility|name": "Royal Glamorgan Hospital",
    "rcpch_growth_chart_calculation/context/report_id": "Report ID 32",
    "rcpch_growth_chart_calculation/context/status": "Final",
    "rcpch_growth_chart_calculation/_feeder_audit/originating_system_audit|system_id": "RCPCH_API",
    "rcpch_growth_chart_calculation/_feeder_audit/original_content": "eyJiaXJ0aF9kYXRhIjp7ImJpcnRoX2RhdGUiOiIyMDIwLTA0LTEyIiwiZ2VzdGF0aW9uX3dlZWtzIjo0MCwiZ2VzdGF0aW9uX2RheXMiOjAsImVzdGltYXRlZF9kYXRlX2RlbGl2ZXJ5IjoiMjAyMC0wNC0xMiIsImVzdGltYXRlZF9kYXRlX2RlbGl2ZXJ5X3N0cmluZyI6IlN1biAxMiBBcHJpbCwgMjAyMCIsInNleCI6ImZlbWFsZSJ9LCJtZWFzdXJlbWVudF9kYXRlcyI6eyJvYnNlcnZhdGlvbl9kYXRlIjoiMjAyOC0wNi0xMiIsImNocm9ub2xvZ2ljYWxfZGVjaW1hbF9hZ2UiOjguMTY3MDA4ODk4MDE1MDU5LCJjb3JyZWN0ZWRfZGVjaW1hbF9hZ2UiOjguMTY3MDA4ODk4MDE1MDU5LCJjaHJvbm9sb2dpY2FsX2NhbGVuZGFyX2FnZSI6IjggeWVhcnMgYW5kIDIgbW9udGhzIiwiY29ycmVjdGVkX2NhbGVuZGFyX2FnZSI6IjggeWVhcnMgYW5kIDIgbW9udGhzIiwiY29ycmVjdGVkX2dlc3RhdGlvbmFsX2FnZSI6eyJjb3JyZWN0ZWRfZ2VzdGF0aW9uX3dlZWtzIjpudWxsLCJjb3JyZWN0ZWRfZ2VzdGF0aW9uX2RheXMiOm51bGx9LCJjb21tZW50cyI6eyJjbGluaWNpYW5fY29ycmVjdGVkX2RlY2ltYWxfYWdlX2NvbW1lbnQiOiJCb3JuIGF0IHRlcm0uIE5vIGNvcnJlY3Rpb24gaGFzIGJlZW4gbWFkZSBmb3IgZ2VzdGF0aW9uLiIsImxheV9jb3JyZWN0ZWRfZGVjaW1hbF9hZ2VfY29tbWVudCI6IllvdXIgY2hpbGQgd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CBIb3Jtb25lIERlZmljaWVuY3kgZGlhZ25vc2lzIl0sImJvbmVfYWdlX3R5cGUiOiJncmV1bGljaC1weWxlIiwiYm9uZV9hZ2Vfc2RzIjoiMi4wIiwiYm9uZV9hZ2VfY2VudGlsZSI6Ijk4LjAiLCJvYnNlcnZhdGlvbl9lcnJvciI6bnVsbCwiYWdlX3R5cGUiOiJjb3JyZWN0ZWRfYWdlIiwiY2FsZW5kYXJfYWdlIjoiOCB5ZWFycyBhbmQgMiBtb250aHMiLCJjb3JyZWN0ZWRfZ2VzdGF0aW9uYWxfYWdlIjoiIiwibGF5X2NvbW1lbnQiOiJZb3VyIGNoaWxkIHdhcyBib3JuIG9uIHRoZWlyIGR1ZSBkYXRlLiIsImNsaW5pY2lhbl9jb21tZW50IjoiQm9ybiBhdCB0ZXJtLiBObyBjb3JyZWN0aW9uIGhhcyBiZWVuIG1hZGUgZm9yIGdlc3RhdGlvbi4iLCJhZ2VfZXJyb3IiOm51bGwsImNlbnRpbGVfYmFuZCI6IlRoaXMgaGVpZ2h0IG1lYXN1cmVtZW50IGlzIGJldHdlZW4gdGhlIDAuNHRoIGFuZCAybmQgY2VudGlsZXMuIiwib2JzZXJ2YXRpb25fdmFsdWVfZXJyb3IiOm51bGx9fX0sImJvbmVfYWdlIjp7ImJvbmVfYWdlIjoxMC4wLCJib25lX2FnZV90eXBlIjoiZ3JldWxpY2gtcHlsZSIsImJvbmVfYWdlX3NkcyI6Mi4wLCJib25lX2FnZV9jZW50aWxlIjo5OC4wLCJib25lX2FnZV90ZXh0IjoiVGhpcyBib25lIGFnZSBpcyBhZHZhbmNlZCJ9LCJldmVudHNfZGF0YSI6eyJldmVudHNfdGV4dCI6WyJHcm93dGggaG9ybW9uZSBzdGFydCIsIkdyb3d0aCBIb3Jtb25lIERlZmljaWVuY3kgZGlhZ25vc2lzIl19fQ==",
    "rcpch_growth_chart_calculation/_feeder_audit/original_content|formalism": "application/js64",
    "rcpch_growth_chart_calculation/child_data/birth_summary/birth_date": "2023-10-27",
    "rcpch_growth_chart_calculation/child_data/birth_summary/birth_detail/gestation": "P22W2D",
    "rcpch_growth_chart_calculation/child_data/birth_summary/comment": "Comment 42",
    "rcpch_growth_chart_calculation/child_data/birth_summary/last_updated": "2023-10-27T13:11:27.515Z",
    "rcpch_growth_chart_calculation/child_data/gender/sex_assigned_at_birth|other": "Sex assigned at birth 5",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age": "P2Y2M",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_text": "Bone age text 87",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_centile|numerator": 31.81,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_centile|denominator": 100.0,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_centile|type": 2,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_sds|magnitude": 98.4,
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age_sds|unit": "1",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/event_text": "Event text 42",
    "rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/bone_age_type": "fels",
    "rcpch_growth_chart_calculation/measurement_data/age/chronological_age": "P3Y3M1W1D",
    "rcpch_growth_chart_calculation/measurement_data/age/corrected_age": "P4M2W3D",
    "rcpch_growth_chart_calculation/measurement_data/age/comment": "Comment 91",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/growth_indicator|code": "at0020",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/uri_to_original_measurement": "https://cdr.code4health.org/rest/v1/composition/bf6a4713-2544-46e4-8dc7-ec38b73eba6c::7815d0e1-7902-453c-835a-f2a57c5dfe57::1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile|numerator": 19.43,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile|denominator": 100.0,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile|type": 2,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/sds|magnitude": 85.32,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/sds|unit": "1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/chronological/centile_band": "Centile band 77",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/growth_indicator|code": "at0020",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/uri_to_original_measurement": "https://cdr.code4health.org/rest/v1/composition/bf6a4713-2544-46e4-8dc7-ec38b73eba6c::7815d0e1-7902-453c-835a-f2a57c5dfe57::1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile|numerator": 54.76,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile|denominator": 100.0,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile|type": 2,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/sds|magnitude": 96.74,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/sds|unit": "1",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/corrected/centile_band": "Centile band 71",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content": "http://med.tube.com/sample",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content|mediatype": "video/H261",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content|alternatetext": "alternate text",
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content|size": 504903212,
    "rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content_name": "Imported RCHPH results"
}

Here is what I changed:
I added language and territory as ctx otherwise they have to be set at every element:

"ctx/language": "en", "ctx/territory": "GB"

Somehow "video/mp4" is not in our list of approved media types.
"rcpch_growth_chart_calculation/measurement_data/length_height_indicator/calculation_results/content|mediatype": "video/H261",

If you look at the web template generated by ehrbase

									"children": [
										{
											"id": "bone_age",
											"name": "Bone age",
											"localizedName": "Bone age",
											"rmType": "DV_DURATION",
											"nodeId": "at0005",
											"min": 0,
											"max": 1,
											"localizedNames": {
												"en": "Bone age"
											},
											"localizedDescriptions": {
												"en": "An estimate of biological age by assessing the degree of maturation of an individual's bones."
											},
											"aqlPath": "/content[openEHR-EHR-SECTION.adhoc.v1 and name/value='Child Data']/items[openEHR-EHR-OBSERVATION.skeletal_age_rcpch.v0]/data[at0001]/events[at0002]/data[at0003]/items[at0005 and name/value='Bone age']/value",
											"inputs": [
												{
													"suffix": "year",
													"type": "INTEGER",
													"validation": {
														"range": {
															"min": 0,
															"minOp": ">="
														}
													}
												},
												{
													"suffix": "month",
													"type": "INTEGER",
													"validation": {
														"range": {
															"min": 0,
															"minOp": ">="
														}
													}
												}
											]
										}

It just bone_age. Something like /duration_value is used when a element offers a choice of different data types. but that not the case here.
"rcpch_growth_chart_calculation/child_data/skeletal_age_rcpch/any_event:0/bone_age": "P2Y2M",

For sex_assigned_at_birth this can either be a Text or a code from https://fhir.hl7.org.uk/ValueSet/UKCore-BirthSex.

						{
									"id": "sex_assigned_at_birth",
									"name": "Sex assigned at birth",
									"localizedName": "Sex assigned at birth",
									"rmType": "DV_CODED_TEXT",
									"min": 0,
									"max": 1,
									"localizedNames": {
										"en": "Sex assigned at birth"
									},
									"localizedDescriptions": {
										"en": "The sex of an individual determined by anatomical characteristics observed and registered at birth."
									},
									"aqlPath": "/content[openEHR-EHR-SECTION.adhoc.v1 and name/value='Child Data']/items[openEHR-EHR-EVALUATION.gender.v1]/data[at0002]/items[at0019]/value",
									"inputs": [
										{
											"suffix": "code",
											"type": "TEXT",
											"listOpen": true,
											"terminology": "https://fhir.hl7.org.uk/ValueSet/UKCore-BirthSex"
										},
										{
											"suffix": "value",
											"type": "TEXT",
											"terminology": "https://fhir.hl7.org.uk/ValueSet/UKCore-BirthSex"
										},
										{
											"suffix": "other",
											"type": "TEXT"
										}

So we have to add |other here to tell ehrbase that we want a DV_TEXT
"rcpch_growth_chart_calculation/child_data/gender/sex_assigned_at_birth|other": "Sex assigned at birth 5",

You find the implementation details for flat in ehrbase in https://ehrbase.readthedocs.io/en/latest/08_flat/index.html

@stefanspiska stefanspiska removed the bug Something isn't working label Nov 30, 2023
@johnmeredith
Copy link
Author

Thanks for the feedback - the payload itself is working fine with Better CDR but I am hitting the differences here. I really appreciate your input!

@vladislavploaia
Copy link
Contributor

Hello @johnmeredith,
Is there something more we can support with?
CC: @stefanspiska , @vidi42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants