Db-doc="true", generated docs with same cretaed_form_name

Hi,
we have 5 app forms that generates data_records using db-doc, all of them, patient_assessment, patient_assesment_over_, family_planning_men, pregnancy_family_planning, moderate_malnutrition_followup, creates a db-doc prescription_summary, but the prescription_summary json key created_from_name is always patient_assessment even if created_form key points a patient_assessment_over_5 doc

I am not sure I am totally following what you are saying here. It sounds like you expect the prescription_summary docs to be created with a field called created_from_name which should be populated with the name of the form that created the prescription_summary doc (“patient_assessment”, “patient_assessment_over_5”, “family_planning_men”, “pregnancy_family_planning”, or “moderate_malnutrition_followup”). However, created_from_name is always just set to “patient_assessment” in all prescription_summary docs regardless of which form actually created the doc. Is this a correct summary of the behavior you are experiencing?

If so, then I think we would need to see an example of the calculation logic you are using (e.g. in the patient_assessment_over_5 form) to populate the created_from_name on the prescription_summary doc. As far as I know, the CHT does not have any logic to auto-populate a field called created_from_name. This seems related to the ability to link docs being written by the same form via a db-doc-ref value, but not exactly the same…

Hi,
Yes you have done the correct behavior summary
I have no experience with db-doc so here you have the patient_assessment and the patient_assessment_over_5 XLSX docs, the prescription_summary group with db-doc is in both files at the end.

I’ve understood the behavior of db-doc-ref
Thank you for this link

1 Like