openimis/openimis-be-location_py — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me the backend location module for openIMIS, meant to plug into the existing openIMIS Python backend.

It should expose location data through GraphQL so other parts of the system can ask for locations, health facilities, searchable health facilities by code or name, and the districts linked to a user. It needs to map the existing database tables for locations, health facilities, and user districts into Django models without trying to create a whole standalone app.

Keep it simple and consistent with the openIMIS backend style. Add the module configuration options for permissions on location and health facility queries, plus an option to skip location checks for national scale setups. There don’t need to be custom services, reports, mutations, or signal listeners.

Please make it production ready enough to install as an openIMIS backend module, with packaging, translations folder support, licensing files, and clean Python formatting. If you need exact openIMIS patterns, look up the current openimis backend module docs online.

Want more depth? Deep Reverse