medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
438 stars 208 forks source link

New Action icon for patients who have delivered once does not display the option to register a new pregnancy #6047

Open kanikamedic opened 4 years ago

kanikamedic commented 4 years ago

Describe the bug I tried registering a new pregnancy for a patient who had delivered a month ago. The 'New Action' icon on her profile page gave me the option to report her death but a new pregnancy form was not listed.

To Reproduce Steps to reproduce the behavior:

  1. Go to the people tab
  2. Search for a patient who has delivered a child in the past
  3. Click on the 'New Action' button
  4. See error

Expected behavior I'm not sure if a constraint has been added on purpose but shouldn't I be able to report a new pregnancy for a woman who has already delivered a child in the past?

Screenshots image

Environment

abbyad commented 4 years ago

It appears that the Pregnancy report is not meant to show until 6 weeks after the most recent delivery: https://github.com/medic/medic/blob/319e133229a84e18807bffc318bfd1958f88e940/config/default/contact-summary-extras.js#L260

Can you verify that it appears after 6 weeks? You can change your computer clock accordingly to check. If it appears you can close the issue, otherwise let us know.

kanikamedic commented 4 years ago

@abbyad I tried changing the date on my computer and am now able to see an option to submit a Delivery form but not a New Pregnancy for this patient.

image

I also looked at some other test patient's profiles for whom more than 6 weeks have passed since the date of delivery and observed the same error. Perhaps that's the result of a different contraint so I'm still sharing a screenshot here.

image

abbyad commented 4 years ago

Thanks for the extra info @kanikamedic. I am assigning @nomulex to dig into this further.

nomulex commented 4 years ago

While looking into this I found another issue. Pregnancy registration and delivery report both appearing in the action item. image