[Analytical Queries] Implement search of rock samples by formation of the wellbore
Context: Users should be able to search for RCA data by formation name
Use Case Scenario
User executes a query to find the RCA data that belongs Formation Name = WolfStock System identifies all existing Rock Sample records that have stored WellboreID within From identified WellboreIDs system retrieves the linked WellboreMarkerSet WPC Within identified WellboreMarkerSet WPC system filters these that have data.Markers[].FeatureTypeID = "data-partition:reference-data–FeatureTypeID:Top" System creates an array of existing formations that should include the following data WellBoreID Formations FormationName = data.Markers[].FeatureName FormationTopDepth = data.Markers[].MarkerMeasuredDepth FormationBottomDepth = will be defined in step #6 (closed) System executes the check to identify if there are multiple objects within each WellboreID: If there are multiple objects, then sort the values of MarkerMeasuredDepth in ascending order. From the sorted list of MarkerMeasuredDepth values identify the closest biggest value to each MarkerMeasuredDepth. Identified closest values should be FormationBottomDepth. FormationBottomDepth of the Formation with the largest MarkerMeasuredDepth should be set to "30000" If there is only one object within the Wellbore ID array, then default FormationBottomDepth is set to "30000" System selects only records where FormationName from the search request = FormationName in the array System selects all Samples that are linked to the WellboreID from the previous step (#7 (closed)) subset using RockSample master metadata records (data.WellboreID = WellboreID from an array) System checks to which RCA identified Samples belong and check the SampleDepth parameter in identified RCA System checks the following condition: FormationTopDepth <= SampleDepth <= FormationBottomDepth If condition is true, then system associates RockSample with the Formation System returns Rock Samples that match the condition System return RCA data which belongs to identified samples Response
// Example of response
{ "RCAID": "opendes:work-product-component--RockSampleAnalysis:dd76cf6c-226f-5636-ad1b-1ca0f8249cc8", "RockSampleID": "namespace:master-data--RockSample:SomeUniqueRockSampleID:226f-5636-ad1b-1ca0f8249cc8", "FormationName": "Wolfstock", "RCAData": { "Conditions": [ { "Pressure": 800, "PressureMeasurementTypeID": "opendes:reference-data--PressureMeasurementType:Overburden:", "Temperature": 12345.6 } ], "Measurements": [ { "Permeability": 4410.0, "PermeabilityMeasurementTypeID": "opendes:reference-data--PermeabilityMeasurementType:Gas:", "Porosity": 35.7, "PorosityMeasurementTypeID": "opendes:reference-data--PorosityMeasurementType:HeliumInjection:" } ] } }