|
1 | 1 | ---
|
2 |
| -title: Questionnaires |
| 2 | +title: Forms |
3 | 3 | ---
|
4 | 4 |
|
5 |
| -# Questionnaire configuration |
| 5 | +# Form configuration |
6 | 6 |
|
7 |
| -This configuration is used to configure a Questionnaire. A Questionnaire is a data entry form used that is compliant to the FHIR specifications for a [Questionnaire](https://www.hl7.org/FHIR/questionnaire.html) |
| 7 | +Forms in FHIR and OpenSRP2 are defined through the [Questionnaire resource](https://www.hl7.org/FHIR/questionnaire.html). |
| 8 | +This configuration is used to configure a Questionnaire. |
8 | 9 |
|
9 | 10 | :::tip
|
10 | 11 | Use this configuration in other configs like profile and register.
|
@@ -328,159 +329,6 @@ triggerConditions | This defines an array of condition for to be met for the eve
|
328 | 329 | eventResourceId | uniqueId of resource id to be closed | yes | |
|
329 | 330 | eventResources | A list of resources to close(Type of ResourceConfig) | yes | | |
|
330 | 331 |
|
331 |
| -## Unique ID assignment |
332 |
| - |
333 |
| -Unique IDs are unique identifier values assigned to a resource (e.g. Patient) and are associated with a single entity. |
334 |
| - |
335 |
| -Unique ID assignment configs determine how pre-generated unique IDs are retrieved from a Group FHIR resource and subsequently populated in a Questionnaire field. |
336 |
| - |
337 |
| -Here is a sample configuration for the unique identifier assignment: |
338 |
| - |
339 |
| -```json |
340 |
| -{ |
341 |
| - "uniqueIdAssignment": { |
342 |
| - "linkId": "phn", |
343 |
| - "idFhirPathExpression": "Group.characteristic.where(exclude=false and code.text='phn').first().value.text", |
344 |
| - "readOnly": false, |
345 |
| - "resource": "Group", |
346 |
| - "sortConfigs": [ |
347 |
| - { |
348 |
| - "paramName": "_lastUpdated", |
349 |
| - "dataType": "DATE", |
350 |
| - "order": "DESCENDING" |
351 |
| - } |
352 |
| - ], |
353 |
| - "resourceFilterExpression": { |
354 |
| - "conditionalFhirPathExpressions": [ |
355 |
| - "Group.active = true and Group.type = 'device' and Group.name = 'Unique IDs'" |
356 |
| - ], |
357 |
| - "matchAll": true |
358 |
| - } |
359 |
| - } |
360 |
| -} |
361 |
| -``` |
362 |
| - |
363 |
| -The configuration contains the following properties: |
364 |
| - |
365 |
| -**linkId** - The linkId for the targeted Questionnaire item |
366 |
| -**idFhirPathExpression** - The FHIR path expression used to extract ID from a resource |
367 |
| -**readOnly** - Enable or disable editing of the field. Defaults to `true` |
368 |
| -**resource** - FHIR resource used to store generated unique IDs |
369 |
| -**sortConfigs** - For ordering resources. It is important to ensure the resources are ordered by last updated |
370 |
| -**resourceFilterExpression** - Extra configurations to apply filter via code on the declared Resource |
371 |
| - |
372 |
| -*NOTE:* If the `readOnly` configuration is set to false, the ID field in the Questionnaire becomes editable. If the prepopulated ID |
373 |
| -is modified and a different ID is submitted with the Questionnaire, the prepopulated ID will not be marked as used. |
374 |
| -This means that it will still be prepopulated the next time the Questionnaire is launched. |
375 |
| - |
376 |
| -## Characteristic-based Group resource for unique IDs |
377 |
| - |
378 |
| -IDs are stored as `text` in a `valueCodeableConcept` in the `characteristic` field. |
379 |
| -The batch of IDs is assigned to a Practitioner using the `managingEntity`. |
380 |
| - |
381 |
| -When an ID is used, the characteristic entry with that ID is updated to be excluded by setting `"exclude": true`. Once all IDs in the Group are used, the group is set to inactive. |
382 |
| - |
383 |
| -## Sample Group resource with unique IDs |
384 |
| - |
385 |
| -```json |
386 |
| -{ |
387 |
| - "resourceType": "Group", |
388 |
| - "id": "37312ad4-538e-4535-82d2-ea14f40deeb9", |
389 |
| - "meta": { |
390 |
| - "versionId": "9", |
391 |
| - "lastUpdated": "2023-12-22T06:43:35.986+00:00", |
392 |
| - "source": "#04a1c85fb6adf0cc", |
393 |
| - "tag": [ |
394 |
| - { |
395 |
| - "system": "https://smartregister.org/care-team-tag-id", |
396 |
| - "code": "3e005baf-854b-40a7-bdd5-9b73f63aa9a3", |
397 |
| - "display": "Practitioner CareTeam" |
398 |
| - }, |
399 |
| - { |
400 |
| - "system": "https://smartregister.org/organisation-tag-id", |
401 |
| - "code": "41eae946-bdc4-4179-b404-6503ff12f59c", |
402 |
| - "display": "Practitioner Organization" |
403 |
| - }, |
404 |
| - { |
405 |
| - "system": "https://smartregister.org/location-tag-id", |
406 |
| - "code": "3816", |
407 |
| - "display": "Practitioner Location" |
408 |
| - }, |
409 |
| - { |
410 |
| - "system": "https://smartregister.org/practitioner-tag-id", |
411 |
| - "code": "49b72a3d-44cd-4a74-9459-4dc9f6b543fa", |
412 |
| - "display": "Practitioner" |
413 |
| - }, |
414 |
| - { |
415 |
| - "system": "https://smartregister.org/app-version", |
416 |
| - "code": "Not defined", |
417 |
| - "display": "Application Version" |
418 |
| - } |
419 |
| - ] |
420 |
| - }, |
421 |
| - "identifier": [ |
422 |
| - { |
423 |
| - "system": "http://smartregister.org", |
424 |
| - "value": "37312ad4-538e-4535-82d2-ea14f40deeb9" |
425 |
| - } |
426 |
| - ], |
427 |
| - "active": true, |
428 |
| - "type": "device", |
429 |
| - "actual": true, |
430 |
| - "name": "Unique IDs", |
431 |
| - "managingEntity": { |
432 |
| - "reference": "Practitioner/49b72a3d-44cd-4a74-9459-4dc9f6b543fa" |
433 |
| - }, |
434 |
| - "characteristic": [ |
435 |
| - { |
436 |
| - "code": { |
437 |
| - "text": "phn" |
438 |
| - }, |
439 |
| - "valueCodeableConcept": { |
440 |
| - "text": "1000010001" |
441 |
| - }, |
442 |
| - "exclude": false |
443 |
| - }, |
444 |
| - { |
445 |
| - "code": { |
446 |
| - "text": "phn" |
447 |
| - }, |
448 |
| - "valueCodeableConcept": { |
449 |
| - "text": "1000020002" |
450 |
| - }, |
451 |
| - "exclude": false |
452 |
| - }, |
453 |
| - { |
454 |
| - "code": { |
455 |
| - "text": "phn" |
456 |
| - }, |
457 |
| - "valueCodeableConcept": { |
458 |
| - "text": "1000030003" |
459 |
| - }, |
460 |
| - "exclude": false |
461 |
| - }, |
462 |
| - { |
463 |
| - "code": { |
464 |
| - "text": "phn" |
465 |
| - }, |
466 |
| - "valueCodeableConcept": { |
467 |
| - "text": "1000040004" |
468 |
| - }, |
469 |
| - "exclude": false |
470 |
| - }, |
471 |
| - { |
472 |
| - "code": { |
473 |
| - "text": "phn" |
474 |
| - }, |
475 |
| - "valueCodeableConcept": { |
476 |
| - "text": "1000050005" |
477 |
| - }, |
478 |
| - "exclude": false |
479 |
| - } |
480 |
| - ] |
481 |
| -} |
482 |
| -``` |
483 |
| - |
484 | 332 | ## Hiding characters in a questionnaire
|
485 | 333 |
|
486 | 334 | Sensitive information typed on a questionnaire can be hidden through adding a linkId extension. A sample linkId with password-widget extension looks like
|
@@ -592,4 +440,4 @@ The QR code widget supports adding an arbitrary number of QR codes, implemented
|
592 | 440 | ]
|
593 | 441 | }
|
594 | 442 | ```
|
595 |
| -The extension's implementation can be found [here](https://github.com/opensrp/fhircore/blob/main/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/sdc/qrCode/EditTextQrCodeViewHolderFactory.kt) |
| 443 | +The extension's implementation can be found [here](https://github.com/opensrp/fhircore/blob/main/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/sdc/qrCode/EditTextQrCodeViewHolderFactory.kt) |
0 commit comments