How can I add a new Appointment Service Type?

Application Name: Reference Application Version Number: 3

Question:

How can I add a new Appointment Service Type? (check image)

Hi @fabian, welcome!

Appointment services are associated with their respective specialties. Both are considered metadata and can be initialized at startup using the Initializer module. To set up new appointment services, locate the appointmentspecialities and appointmentservicedefinitions folders on your deployment and add the relevant CSV lines there and restart the application.

2 Likes

Additionally this is documented here :backhand_index_pointing_right: Initializer Domain ‘appointmentservicetypes’.

Thank you for your reply. What would be the better approach if I am using a Docker deployment? If I edit that file inside the Docker image I will lose the changes when I recreate the image. I know I can create a persistent volume, but when I create a new deployment, the configuration folder doesn’t exist ((feat) O3-2353: Use demo data content package by NethmiRodrigo · Pull Request #889 · openmrs/openmrs-distro-referenceapplication · GitHub).

In fact, if I edit the mentioned files and then restart de application, the newly added lines dissapear.

Which Docker setup are you using—are you working with the latest Ref App SNAPSHOT version available on GitHub, or an older one? If you’re using the latest SNAPSHOT, a better approach—especially for testing—is to build the relevant artifacts step by step based on your changes.

Here’s the recommended process:

  1. Build the openmrs-content-referenceapplication-demo artifact that includes your changes.
  2. Build the openmrs-distro-referenceapplication artifact, making sure to reference the updated demo package version by setting the reference-demo-content.version property in the distro/pom.xml file to the version built in step 1.
  3. Redeploy the application with the updated artifacts.

This above should help you make progress testing the changes you have made.

If I understand correctly, in order to modify the configuration, I need to completely rebuild the system (including rebuilding the database and losing all data?) and I cannot modify the configuration at runtime by just restarting the container? I tried modifying the files (in a persistent volume) and restarting the container, but the modifications disappear when the container starts.

@fabian, would you mind sharing the project or a reference example you’re currently working with so we can stay aligned and better support you? It looks like you already have some technical ability to address issues, particularly with Docker.

Depending on your goals—whether you’re aiming to test changes with or w/out building what should be deployed, or you’re targeting a demo server that doesn’t need to be provisioned from scratch—there are different approaches we can take to update the deployed instance:

  1. If you’re making changes through artifacts and aren’t concerned with how Docker images or volumes are structured (good for simple testing), then rebuilding the relevant artifacts—as previously discussed—would be the ideal path.
  2. If you’re directly working with Docker images or containers, you might want to inspect the relevant image layers to determine the appropriate volume mount paths. In most cases, the relevant path (where iniz config changes are to be added) would be /openmrs/distribution/openmrs_config.

Let us know how you’d like to proceed.

1 Like