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

Handle templated contact/place forms #4

Closed
alxndrsn opened this issue Jun 29, 2017 · 4 comments
Closed

Handle templated contact/place forms #4

alxndrsn opened this issue Jun 29, 2017 · 4 comments
Assignees

Comments

@alxndrsn
Copy link
Contributor

alxndrsn commented Jun 29, 2017

The forms PLACE_TYPE-create.xlsx, PLACE_TYPE-edit.xlsx need to be converted to:

  • clinic-create.xml
  • clinic-edit.xml
  • district_hospital-create.xml
  • district_hospital-edit.xml
  • health_center-create.xml
  • health_center-edit.xml

The only difference between them is that PLACE_TYPE and PLACE_NAME are replaced differently.

The XForm also has some custom edits to work as a place form and create the contact properly:

The forms at https://github.com/medic/medic-projects/tree/master/standard/forms are fully generated by this convention, so tests could be created based around the xlsx and forms in that project.

@alxndrsn alxndrsn self-assigned this Jul 18, 2017
@alxndrsn
Copy link
Contributor Author

Implementation

  1. Create forms/contact/PLACE_TYPE-create.xlsx
  2. Create forms/contact/PLACE_TYPE-edit.xlsx
  3. Create forms/contact/place-types.json:
{
  "clinic": "Clinic",
  "district_hostpital": "District Hostpital",
  "health_center": "Health Center"
}
  1. run medic-conf convert-contact-forms as before, and the relevant xforms will be created from the templates.

@abbyad does this look suitable? If you want a way to share template xlsx between projects, this could easily be added. E.g. by changing the JSON file like so:

{
  "templates": "../standard/forms/contact",
  "types": {
    "clinic": "Clinic",
    "district_hostpital": "District Hostpital",
    "health_center": "Health Center"
  }
}

@alxndrsn
Copy link
Contributor Author

Released in version 1.5.6.

@abbyad
Copy link
Contributor

abbyad commented Oct 5, 2017

Overall this works great, and is a nice improvement over having to do this step manually!

Reopening since these don't seem to be done:

  • Move custom place field from init to within place form - so that it isn't saved in place doc
    • Rational: we need to show this field in the place group only when relevant, so cannot fully replace the place's name field. Having it there full time would mean having a non-relevant field saved with the place, which is a duplicate field and possibly junk.
    • Currently done crudely here
  • Move new contact person to first page - move the group inside previous group
    • Rational: we want to show the new contact fields below the "Select Primary Contact" question, not on a separate page.
    • Currently done crudely here

@abbyad abbyad reopened this Oct 5, 2017
@alxndrsn
Copy link
Contributor Author

alxndrsn commented Oct 9, 2017

Filed separately at #21 and #22

@alxndrsn alxndrsn closed this as completed Oct 9, 2017
alxndrsn pushed a commit to medic/cht-core that referenced this issue Jun 27, 2018
alxndrsn pushed a commit to medic/cht-core that referenced this issue Jun 28, 2018
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

2 participants