Adding Attendant's Details #7778
Replies: 2 comments 6 replies
-
@oni-on1003 thanks for reaching out! Currently the form is consisted of a collection of specific fields. Some of which are 'required' and some are 'optional'. All are validated in the config form validation service here. Any addition to this set of fields, is implemented as 'custom' . In your case, you are going to add a 'custom' section, which means it should have all of its fields configured as custom. We can configure a field as custom by setting its |
Beta Was this translation helpful? Give feedback.
-
@tahmidrahman-dsi Thank you for your help. It's working perfectly now. Here's the function just in case someone needs it.
Usage
|
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this is the right section for this post.
I would like to capture the attendant's information, like name, occupation (title/designation), and address, and then display it on the certificate.
I tried to add a new section called "attendant" in country-config > src > form > birth > index.ts.
When I submit the form there's an error undefined "attendant" in type BirthRegistration
To fix the error I edit the following core file(sorry for this but I need to figure out how the system works)
type BirthRegistration implements EventRegistration { ...., attendant: Person # -> .section(code='attendant-details').entry.reference }
input BirthRegistrationInput { ...., attendant: PersonInput }
export interface BirthRegistration { ...., attendant?: Person }
import { ...., ATTENDANT_CODE, ATTENDANT_TITLE } from '..'
const builders: IFieldBuilders = { ...., attendant: { _fhirID: (fhirBundle, fieldValue) => { const attendant = selectOrCreatePersonResource( ATTENDANT_CODE, ATTENDANT_TITLE, fhirBundle ) attendant.id = fieldValue as string }, identifier: createIDBuilder( ATTENDANT_CODE, ATTENDANT_TITLE), name: createNameBuilder( ATTENDANT_CODE, ATTENDANT_TITLE), address: createAddressBuilder( ATTENDANT_CODE, ATTENDANT_TITLE), } }
export const ATTENDANT_TITLE = "Attendant's details"
export const ATTENDANT_CODE = 'attendant-details'
type ReferenceType = ..... | { code: typeof ATTENDANT_CODE reference: Reference['reference'] title: typeof ATTENDANT_TITLE }
Unfortunately, I wasn't able to store the attendant's details. I hope someone can help me solve the problem. I'm currently using the v1.5 master.
If the OpenCRVS team finds it useful, I can make a pull request once I've finished it.
Beta Was this translation helpful? Give feedback.
All reactions