Project

General

Profile

Feature #829

Updated by RishiKesh Tuniki about 2 months ago

# THIS DOES NOT REQUIRE THE AUTH VERIFICATION FROM SERVER APIS AS THE IMAGES WLL BE UPLOADED DIRECTLY TO S3 BUCKET 

 We need to refactor the existing image upload and retrieval logic to align with the new patient GUID–based approach and simplify API usage by consolidating logic into the config screen. 

 This work involves two major changes: 

 # 1. Update Image Upload Logic 
 **Scope** 

 Refactor the upload flow by removing legacy dependencies and resolving patients via a unified API before storing images. 
 **Changes Required** 

 * **Combine APIs in Config Screen** 
    * Update the upload logic so all three APIs are combined and handled from the config screen. 
 * **Remove Unused Dependencies** 
    * Remove usage of: 
      * **mediabase** 
      * **patients**    (legacy logic) 
 ![](clipboard-202602211718-pzlpa.png) 

 * Image Source 
    * Upload logic should retrieve images **directly from** **pdata** . 
 * Patient Folder Processing 
   * Read patient folders in the format: 
 ``` 
 P_0000{SidexisPatientId} 
 ``` 
 ![](clipboard-202602211719-64fcz.png) 
   * From    patient Table: 
     * Read all rows mapping to SidexisPatientId 
     * Extract the list of **Card IDs** 
     * Ignore Patients who have the CardId Empty.  
 ![](clipboard-202602211720-fij5k.png) 
 * **Patient Resolution** 
   * For each Card ID, call the resolver API: 
 ``` 
 https://apistg.dentpal.aumtech.org/api/app/patient-pms-resolver/resolve 
 ``` 

   * Retrieve a mapping of: 
 ``` 
 patientGuid ↔ cardId 
 ``` 
 ![](clipboard-202602211720-cb2jk.png) 
 * Image Storage 
 * Use the resolved **patientGuid**    to store images in the following format: 
 ``` 
 images/{patientGuid}/ 
 ``` 
 Please don't use this logic as the service which uploads images doesn't have the current tenant info if you need any unique parameter you can use clinicId 
 ![](clipboard-202602211723-yvnok.png) 
 * Image Name Resolution 

   * Fetch image names from the **mediabase**    table by mapping: 
 ``` 
 imageId → imageName 
 ``` 
 ![](clipboard-202602211723-ogyi0.png) 
   * Image ID corresponds to the file name inside **pdata** : 
 ``` 
 0000_{imageId}.dcm 
 ``` 
 ![](clipboard-202602211723-drsbe.png) 

 # 2. Update Image Retrieval Logic 
 **Scope** 
 Refactor image retrieval to align with the new patient GUID–based storage structure. 
 **Changes Required** 
 * Retrieve images **only using patientGuid** 
 This should not be used as tenant info will not be used 
 ![](clipboard-202602211725-hqzxx.png) 
 * Update retrieval path to: 
 ``` 
 images/{patientGuid}/ 
 ``` 
 * Remove any dependency on: 
   * Card ID–based lookup 
   * Legacy patient or mediabase paths

Back