Skip to content

0.0.3

Compare
Choose a tag to compare
@Markionium Markionium released this 07 Feb 17:48
· 44 commits to master since this release

Changes

  • Adds partner view
  • Fixes field filtering

Installation instructions

Add SqlView

Note to change auth <auth string> to an actually valid auth string.
And change the url to the correct server :)

curl --request POST \
  --url https://dev.datim.org/api/sqlViews \
  --header 'authorization: <auth string>' \
  --header 'content-type: application/json' \
  --data '\n        {\n            "created": "2017-02-07T13:19:48.957",\n            "lastUpdated": "2017-02-07T13:19:48.957",\n            "name": "APP_MechanismFinder-PartnerSQLView",\n            "id": "Lamorm6y2sQ",\n            "sqlQuery": "SELECT * FROM (SELECT co.name AS mechanism, (\r\n\t\tSELECT _cog.uid\r\n\t\tFROM categoryoptiongroup _cog\r\n\t\tJOIN categoryoptiongroupsetmembers _cogsm ON _cog.categoryoptiongroupid = _cogsm.categoryoptiongroupid\r\n\t\tJOIN categoryoptiongroupmembers _cogm ON _cog.categoryoptiongroupid = _cogm.categoryoptiongroupid\r\n\t\tJOIN categoryoptioncombos_categoryoptions _coco ON _cogm.categoryoptionid = _coco.categoryoptionid\r\n\t\tWHERE _coco.categoryoptionid = co.categoryoptionid AND _cogsm.categoryoptiongroupsetid = 481662\r\n\t\tLIMIT 1\r\n\t) AS partnerId, (\r\n\t\tSELECT _cog.name\r\n\t\tFROM categoryoptiongroup _cog\r\n\t\tJOIN categoryoptiongroupsetmembers _cogsm ON _cog.categoryoptiongroupid = _cogsm.categoryoptiongroupid\r\n\t\tJOIN categoryoptiongroupmembers _cogm ON _cog.categoryoptiongroupid = _cogm.categoryoptiongroupid\r\n\t\tJOIN categoryoptioncombos_categoryoptions _coco ON _cogm.categoryoptionid = _coco.categoryoptionid\r\n\t\tWHERE _coco.categoryoptionid = co.categoryoptionid AND _cogsm.categoryoptiongroupsetid = 480936\r\n\t\tLIMIT 1\r\n\t) AS agency,\r\n\to.name AS ou,\r\n\tco.startdate,\r\n\tco.enddate\r\n\tFROM dataelementcategoryoption co\r\n\tLEFT JOIN categoryoption_organisationunits coou ON coou.categoryoptionid = co.categoryoptionid\r\n\tLEFT JOIN organisationunit o ON o.organisationunitid = coou.organisationunitid\r\n\tWHERE co.name::text ~ '\''^\\d{3}.*'\''::text AND o.uid = '\''${organisationUnitId}'\'' ORDER BY co.name) as mechanismsForOrgUnit\r\nWHERE partnerId = '\''${partnerId}'\'';",\n            "publicAccess": "rw------",\n            "description": "",\n            "type": "QUERY",\n            "externalAccess": false,\n            "cacheStrategy": "RESPECT_SYSTEM_SETTING",\n            "user": {\n                "id": "ab7NYsOIsQM"\n            },\n            "userGroupAccesses": [],\n            "attributeValues": []\n        }\n'

Add system setting

Note to change auth <auth string> to an actually valid auth string.
And change the url to the correct server :)

curl --request POST \
  --url https://dev.datim.org/api/systemSettings/keyAPP_MechanismFinder-PartnerSQLView \
  --header 'authorization: <auth string>' \
  --header 'content-type: text/plain' \
  --data '{"value": "Lamorm6y2sQ"}'

Install app

Install the attached zipfile with this release mechanism-finder.zip as an app into dhis2.