Index: demo/src/main/assets/new-patient-registration-paginated.json IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/demo/src/main/assets/new-patient-registration-paginated.json b/demo/src/main/assets/new-patient-registration-paginated.json --- a/demo/src/main/assets/new-patient-registration-paginated.json (revision 675237f7f9b8f5a83f6277e70eb4b84b03a76fb2) +++ b/demo/src/main/assets/new-patient-registration-paginated.json (date 1683186322362) @@ -19,361 +19,25 @@ ], "item": [ { - "linkId": "PR", + "linkId": "1", + "text": "Group Item", "type": "group", - "text": "Client info", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Maelezo ya mteja" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - }, - "item": [ - { - "linkId": "PR-name", - "type": "group", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.name", - "item": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "language": "text/fhirpath", - "expression": "Patient.name.given", - "name": "patientName" - } - } - ], - "linkId": "PR-name-text", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.name.given", - "type": "string", - "required": true, - "text": "First Name", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Jina la kwanza" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - } - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "language": "text/fhirpath", - "expression": "Patient.name.family", - "name": "patientFamily" - } - } - ], - "linkId": "PR-name-family", - "definition": "http://hl7.org/fhir/StructureDefinition/datatypes#HumanName.family", - "type": "string", - "required": true, - "text": "Family Name", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Jina la ukoo" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - } - } - ] - }, - { - - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "language": "text/fhirpath", - "expression": "Patient.birthDate", - "name": "patientBirthDate" - } - } - ], - "linkId": "patient-0-birth-date", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.birthDate", - "type": "date", - "required": true, - "text": "Date of Birth", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Tarehe ya kuzaliwa" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - } - }, - { - "linkId": "patient-0-gender", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.gender", - "type": "choice", - "text": "Gender", - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "system": "http://hl7.org/fhir/administrative-gender", - "language": "text/fhirpath", - "expression": "Patient.gender", - "name": "patientGender" - } - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://hl7.org/fhir/questionnaire-item-control", - "code": "radio-button", - "display": "Radio Button" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation", - "valueCode": "horizontal" - } - ], - "answerOption": [ - { - "valueCoding": { - "system": "http://hl7.org/fhir/administrative-gender", - "code": "female", - "display": "Female", - "designation": [ - { - "language": "sw", - "value": "Mwanamke" - }] - } - }, - { - "valueCoding": { - "system": "http://hl7.org/fhir/administrative-gender", - "code": "male", - "display": "Male", - "designation": [ - { - "language": "sw", - "value": "Mwanaume" - }] - } - } - ] - }, - { - "linkId": "PR-telecom", - "type": "group", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.telecom", - "item": [ - { - "linkId": "PR-telecom-system", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.telecom.system", - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden", - "valueBoolean": true - } - ], - "type": "string", - "text": "system", - "initial": [ - { - "valueString": "phone" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "language": "text/fhirpath", - "expression": "Patient.telecom.value", - "name": "patientTelecom" - } - } - ], - "linkId": "PR-telecom-value", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.telecom.value", - "type": "string", - "required": true, - "text": "Phone Number", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Nambari ya simu" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - } - } - ] - }, - { - "linkId": "PR-address", - "type": "group", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.address", - "item": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "language": "text/fhirpath", - "expression": "Patient.address.city", - "name": "patientCity" - } - } - ], - "linkId": "PR-address-city", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.address.city", - "type": "string", - "required": true, - "text": "City", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Mji" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - } - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "language": "text/fhirpath", - "expression": "Patient.address.country", - "name": "patientCity" - } - } - ], - "linkId": "PR-address-country", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.address.country", - "type": "string", - "required": true, - "text": "Country", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Nchi" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - } - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", - "valueExpression": { - "language": "text/fhirpath", - "expression": "Patient.active", - "name": "patientActive" - } - } - ], - "linkId": "PR-active", - "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.active", - "type": "boolean", - "text": "Is Active?", - "_text": { - "extension": [ - { - "extension": [ - { - "url": "lang", - "valueCode": "sw" - }, - { - "url": "content", - "valueString": "Inatumika?" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/translation" - } - ] - } + "required": true, + "repeats": false, + "item": [ + { + "linkId": "1.1", + "text": "First Nested Item", + "type": "boolean", + "required": true, + "repeats": false + }, + { + "linkId": "1.2", + "text": "Second Nested Item", + "type": "boolean", + "required": true, + "repeats": false } ] } Index: demo/src/main/java/com/google/android/fhir/demo/AddPatientFragment.kt IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/demo/src/main/java/com/google/android/fhir/demo/AddPatientFragment.kt b/demo/src/main/java/com/google/android/fhir/demo/AddPatientFragment.kt --- a/demo/src/main/java/com/google/android/fhir/demo/AddPatientFragment.kt (revision 675237f7f9b8f5a83f6277e70eb4b84b03a76fb2) +++ b/demo/src/main/java/com/google/android/fhir/demo/AddPatientFragment.kt (date 1683186322358) @@ -79,10 +79,19 @@ } private fun addQuestionnaireFragment() { + val questionnaireResponseString="""{ + "resourceType": "QuestionnaireResponse", + "item": [ + { + "linkId": "1", + "text":"Group Item" + } + ] +}""" childFragmentManager.commit { add( R.id.add_patient_container, - QuestionnaireFragment.builder().setQuestionnaire(viewModel.questionnaire).build(), + QuestionnaireFragment.builder().setQuestionnaire(viewModel.questionnaire).setQuestionnaireResponse(questionnaireResponseString).build(), QUESTIONNAIRE_FRAGMENT_TAG ) }