Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
integration:nhlmis [2023/01/16 16:58] Gary Willettsintegration:nhlmis [2023/01/17 09:47] (current) Gary Willetts
Line 7: Line 7:
     - requisitions (orders) you receive from NHLMIS will not be added because the customer or items are not recognised by mSupply     - requisitions (orders) you receive from NHLMIS will not be added because the customer or items are not recognised by mSupply
   - NHLMIS must be configured so that the API key relates to the correct stores in your mSupply installation.   - NHLMIS must be configured so that the API key relates to the correct stores in your mSupply installation.
 +</WRAP>
 +
 +<WRAP important center round 90%>
 +Currently, there is no functionality to show the program a particular order is for or to force the selection of stock that belongs to the correct program. This might be added in a future upgrade. 
 </WRAP> </WRAP>
  
Line 18: Line 22:
   * **Server URL:** The URL of the NHLMIS interface. Enter everything without the resource to be called and the final "/" e.g. ''%%https://dev.api.nscip.field.supply/v1%%'' (this is actually the URL of the NHLMIS test server).   * **Server URL:** The URL of the NHLMIS interface. Enter everything without the resource to be called and the final "/" e.g. ''%%https://dev.api.nscip.field.supply/v1%%'' (this is actually the URL of the NHLMIS test server).
   * **API key:** The authentication key for your organisation. This will be provided by the NHLMIS team.   * **API key:** The authentication key for your organisation. This will be provided by the NHLMIS team.
-  * **Error email:** The email address for error emails to be sent to.+  * **Error email:** The email address for error emails to be sent to. Separate multiple email addresses with a semicolon ('';'') if you want error emails to be sent to multiple addresses.
   * **Stores to send stock and receive requisitions for table:** This table contains a row for every store in the datafile. Check the checkbox in the //Send stock & Fetch requisitions// column (by clicking on it) for each store you want to send stock to and fetch requisitions for in the NHLMIS interface.   * **Stores to send stock and receive requisitions for table:** This table contains a row for every store in the datafile. Check the checkbox in the //Send stock & Fetch requisitions// column (by clicking on it) for each store you want to send stock to and fetch requisitions for in the NHLMIS interface.
  
Line 36: Line 40:
 Click on the **OK** button to save any settings you have changed; changes will not be put into effect until they are saved by clicking this button Click on the **OK** button to save any settings you have changed; changes will not be put into effect until they are saved by clicking this button
  
-===== What happens =====+===== What it does =====
 ==== Sending stock ==== ==== Sending stock ====
 +The current stock in each store selected in the **Stores to send stock and receive requisitions for** table is sent to NHLMIS automatically on the schedule defined by the **No. of days between sends** and **Time to send** field.
  
 +Each time a send is made the following is done in this order, one store at a time:
 +  - all the batches in stock (i.e. where available stock is more than 0) are sent to NHLMIS by calling the ''/batches'' endpoint. If all successful then proceed to the next step. If not all are successful then record error and stop.
 +  - all current stock lines (i.e. where available stock is more than 0) are sent to NHLMIS by calling the ''/stock-counts'' endpoint.
 +  - The success or failure of each send for each store is logged.
  
  
 ==== Fetching requisitions ==== ==== Fetching requisitions ====
 +All the outstanding orders (which become requisitions in mSupply) for this mSupply installation which have become outstanding since the last "since marker" are automatically fetched from NHLMIS on a schedule defined by the **No. of minutes between fetches** field.
  
 +If there are more than 50 outstanding orders then mSupply will automatically ask NHLMIS to send the next 50 until all outstanding orders have been retrieved.
  
 +Each time orders are successfully retrieved, the "since" marker that mSupply uses for the request is updated with the value returned by NHLMIS. And if the "since" marker is for a different day to the last since marker stored, it is added to the  **Set "since" marker" to** drop down list (only the 5 most recent markers are stored in this drop down list - if there are already 5 then the oldest is replaced with the new one).
  
 +Each order received from NHLMIS is saved as a requisition in the appropriate store in mSupply. The NHLMIs order ID is stored in the **Their ref** field of each requisition.
  
-===== Errors =====+Any orders that have already been received from NHLMIS and saved in mSupply are not saved again, they are ignored.
  
 +
 +===== Errors =====
 +If errors are encountered during the sending of stock or fetching orders then information about the error is saved in the log (see the [[admin:the_log]] page for details) and an email giving details of the error is sent to the email address stored in the **Error email** field. 
  
 \\ \\
  • Last modified: 2023/01/16 16:58
  • by Gary Willetts