Skip to content

Commit

Permalink
(pre-release) update staging build-config (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldkibet authored Sep 5, 2024
1 parent 306d2f6 commit 16a10f9
Show file tree
Hide file tree
Showing 13 changed files with 408 additions and 932 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deployment_8500_spa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Execute Development Build Script
run: |
chmod +x ./dev-build.sh
./dev-build.sh
echo "n" | ./dev-build.sh
- name: Compress frontend folder
run: tar -czvf frontend-${{ github.sha }}.tar.gz frontend/
Expand Down
25 changes: 20 additions & 5 deletions dev-build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash
#!/usr/bin/env bash

# Clean up previous build artifacts
echo "Cleaning up previous build artifacts ..."
rm -rf openmrs-config-kenyaemr
rm -rf frontend

# Prompt user for KDOD asset generation
read -p "Is this for KDOD asset generation? (y/n): " is_kdod

# Build assets
echo "Building Kenya EMR 3.x assets ..."
CWD=$(pwd)
Expand All @@ -30,7 +33,21 @@ cp "${CWD}/assets/favicon.ico" "${CWD}/frontend"
cp "${CWD}/frontend-config/dev/kenyaemr.config.json" "${CWD}/frontend"
cp "${CWD}/frontend-config/dev/openmrs.config.json" "${CWD}/frontend"

# Function to handle openmrs-esm apps
# Copy KDOD config or registration config based on user input and update index.html
if [ "$is_kdod" = "y" ] || [ "$is_kdod" = "Y" ]; then
echo "Copying KDOD configuration..."
cp "${CWD}/frontend-config/registration/kdod.config.json" "${CWD}/frontend"

# Update the configUrls in index.html
sed -i.bak 's/configUrls: \[/configUrls: \["${openmrsSpaBase}\/kdod.config.json", /' "${CWD}/frontend/index.html" && rm "${CWD}/frontend/index.html.bak"
else
echo "Copying registration configuration..."
cp "${CWD}/frontend-config/registration/registration.config.json" "${CWD}/frontend"

# Update the configUrls in index.html
sed -i.bak 's/configUrls: \[/configUrls: \["${openmrsSpaBase}\/registration.config.json", /' "${CWD}/frontend/index.html" && rm "${CWD}/frontend/index.html.bak"
fi

# Function to handle the renaming process
rename_dist_folder() {
local pattern=$1
Expand Down Expand Up @@ -59,8 +76,6 @@ rename_dist_folder() {

# Handle renaming for openmrs-esm-form-entry-app-*
rename_dist_folder "openmrs-esm-form-entry-app-*" "dist-form-entry"
#rename_dist_folder "openmrs-esm-stock-management-app-*" "dist-stock"


# Exit with success status
exit 0
exit 0
292 changes: 0 additions & 292 deletions frontend-config/dev/kenyaemr.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,298 +243,6 @@
}
]
},
"@kenyaemr/esm-patient-registration-app": {
"defaultPatientIdentifierTypes": [
"49af6cdc-7968-4abb-bf46-de10d7f4859f",
"68449e5a-8829-44dd-bfef-c9c8cf2cb9b2",
"6428800b-5a8c-4f77-a285-8d5f6174e5fb",
"b4d66522-11fc-45c7-83e3-39a1af21ae0d",
"be9beef6-aacc-4e1f-ac4e-5babeaa1e303",
"ca125004-e8af-445d-9436-a43684150f8b",
"52c3c0c3-05b8-4b26-930e-2a6a54e14c90"
],
"sections": [
"demographics",
"contact",
"custom",
"relationships",
"nextOfKin"
],
"sectionDefinitions": [
{
"id": "custom",
"name": "Demographics",
"fields": [
"maritalStatus",
"occupation",
"education"
]
},
{
"id": "contact",
"name": "Contact Details",
"fields": [
"address",
"phone",
"alternatePhone",
"address.address1",
"email",
"address.address6",
"address.address5",
"address.cityVillage",
"address.address2",
"healthCenter"
]
},
{
"id": "nextOfKin",
"name": "Next of Kin Details",
"fields": [
"nextOfKinName",
"nextOfkinRelationsip",
"nextOfkinPhone",
"nextOfKinAddress"
]
}
],
"fieldDefinitions": [
{
"id": "alternatePhone",
"type": "person attribute",
"uuid": "94614350-84c8-41e0-ac29-86bc107069be",
"label": "Alternate phone number",
"validation": {
"matches": "^0([0-9](?:(?:[0-9][0-9])|(?:0[0-8])|(4[0-1]))[0-9]{6})$"
}
},
{
"id": "address.address1",
"type": "address",
"label": "Postal Address"
},
{
"id": "email",
"type": "person attribute",
"uuid": "b8d0b331-1d2d-4a9a-b741-1816f498bdb6",
"label": "Email address",
"validation": {
"matches": "^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$"
}
},
{
"id": "address.address6",
"type": "address",
"label": "Location",
"validation": {
"required": true
}
},
{
"id": "address.address5",
"type": "address",
"label": "Sub-location",
"validation": {
"required": true
}
},
{
"id": "address.cityVillage",
"type": "address",
"label": "Village",
"validation": {
"required": true
}
},
{
"id": "address.address2",
"type": "address",
"label": "Landmark",
"validation": {
"required": true
}
},
{
"id": "healthCenter",
"type": "person attribute",
"uuid": "27573398-4651-4ce5-89d8-abec5998165c",
"label": "Nearest Health Center ",
"validation": {
"required": true
}
},
{
"id": "maritalStatus",
"type": "obs",
"uuid": "1054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Marital status",
"validation": {
"required": true
},
"customConceptAnswers": [
{
"uuid": "159715AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Married polygamous"
},
{
"uuid": "5555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Married monogamous"
},
{
"uuid": "1058AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Divorced"
},
{
"uuid": "1059AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Widowed"
},
{
"uuid": "1060AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Cohabiting"
},
{
"uuid": "1057AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Single"
}
]
},
{
"id": "occupation",
"type": "obs",
"uuid": "1542AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"validation": {
"required": true
},
"customConceptAnswers": [
{
"uuid": "1538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Farmer"
},
{
"uuid": "1540AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Employee"
},
{
"uuid": "1539AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Trader"
},
{
"uuid": "159465AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Student"
},
{
"uuid": "159466AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Driver"
},
{
"uuid": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "None"
},
{
"uuid": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Other"
}
]
},
{
"id": "education",
"type": "obs",
"uuid": "1712AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Education",
"validation": {
"required": true
},
"customConceptAnswers": [
{
"uuid": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "None"
},
{
"uuid": "1713AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Primary school education"
},
{
"uuid": "1714AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Secondary school education"
},
{
"uuid": "159785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "College, university or polytechnic"
}
]
},
{
"id": "nextOfKinName",
"type": "person attribute",
"uuid": "830bef6d-b01f-449d-9f8d-ac0fede8dbd3",
"label": "Name"
},
{
"id": "nextOfkinRelationsip",
"type": "person attribute",
"uuid": "d0aa9fd1-2ac5-45d8-9c5e-4317c622c8f5",
"label": "Relationship"
},
{
"id": "nextOfkinPhone",
"type": "person attribute",
"uuid": "342a1d39-c541-4b29-8818-930916f4c2dc",
"label": "Phone Number",
"validation": {
"matches": "^0([0-9](?:(?:[0-9][0-9])|(?:0[0-8])|(4[0-1]))[0-9]{6})$"
}
},
{
"id": "nextOfKinAddress",
"type": "person attribute",
"uuid": "7cf22bec-d90a-46ad-9f48-035952261294",
"label": "Postal Address"
}
],
"registrationObs": {
"encounterTypeUuid": "de1f9d67-b73e-4e1b-90d0-036166fc6995",
"registrationFormUuid": "add7abdc-59d1-11e8-9c2d-fa7ae01bbebc"
},
"fieldConfigurations": {
"name": {
"displayCapturePhoto": false,
"allowUnidentifiedPatients": false
},
"dateOfBirth": {
"useEstimatedDateOfBirth": {
"enabled": true,
"dayOfMonth": 15,
"month": 5
}
},
"gender": [
{
"value": "male",
"label": "Male"
},
{
"value": "female",
"label": "Female"
}
],
"address": {
"useAddressHierarchy": {
"useAddressHierarchyLabel": {
"countyDistrict": "County",
"address4": "Ward",
"stateProvince": "Sub county"
},
"searchAddressByLevel": true
}
},
"phone": {
"personAttributeUuid": "b2c38640-2603-4629-aebd-3b54f33f1e3a",
"validation": {
"required": true,
"matches": "^0([0-9](?:(?:[0-9][0-9])|(?:0[0-8])|(4[0-1]))[0-9]{6})$"
}
}
}
},
"@kenyaemr/esm-procedure-app": {
"procedureOrderTypeUuid": "b4a7c280-369e-4d12-9ce8-18e36783fed6"
},
Expand Down
3 changes: 0 additions & 3 deletions frontend-config/kdod/README.md

This file was deleted.

Loading

0 comments on commit 16a10f9

Please sign in to comment.