NOTE: This is a public repository. Images or logs containing protected health information (PHI) must be fully-redacted.
Describe the Bug
After adding a new place level(Supervisor Area), I attempt to move contacts (CHW Areas) to be the children of this new place.
However, I get a hierarchy constraint error…
ERROR Error: Hierarchy Constraints: contacts of type ‘health_center’ cannot have parent of type 'contact’
The medic docs recommend we have the new place type with properties
“type” set to contact
“contact_type” set to the custom_place_name
Here is a sample doc
- _id: “27a70730-eba6-4409-9cbe-4934a50c02fa”},
- _id: “029be058-aae5-48bd-85c3-9ee4419da7ac”},
name: “Supervisor Abby Supervisor Area”,
How To Reproduce The Issue
- Creat a Supervisor Area place
- Get a list of CHW Areas you need to migrate to the new Level
- Use the medic-conf move-contacts command
- See error
I expect to migrate contacts in the new hierarchy without errors.
- Instance: (eg: alpha.dev.medicmobile.org, etc)
- Browser: (eg: Firefox, Chrome, incognito mode, etc, which worked, which didn’t)
- Client platform: (eg: Windows, MacOS, Linux)
- App: (eg: webapp, admin, sentinel, api, couch2pg, medic-conf, etc)
- Version: 3.7
The workaround was to edit the “type” property to have the value "custom_place_name’
e.g “type”: “supervisor_area”. But will need to later change it back to “type”:“contact” after a successful migration.