Import Sample Results
A ProcessEvents message with either a NotifyWorkExecutedEvent or NotifyWorkReconciledEvent node can be used to import sample results for existing samples in MineMarket. MaterialLot and MaterialActual sub-nodes may be used to import sample results.
Composite samples are used to determine the quality of bulk material in a despatch, either overall, or for selected transactions regardless of the tonnage in each transaction.
Sample results may be imported with transactions (see Import Transactions) or in a file that contains only sample data. An example scenario is when a 'destructive' sample is taken from a bulk material movement and no transaction process flow exists in MineMarket to represent the movement of the sample material to its destination (a laboratory). In this scenario, the file's HierarchyScope may include a location that does not exist in MineMarket. Information in other nodes is used to identify the sample and process flow to which the sample results belong.
Note: Words in coloured text refer to node names in the XML file. Words in bold refer to field names or data in MineMarket, or required text strings. Words in italics refer to field values in MineMarket.
Subscriber Name
The subscriber name must be NotifyWorkExecutedEvent or NotifyWorkReconciledEvent.
Class Name
The class names are BulkTrak.Integration.PublishSubscribe.B2MML_Classes.NotifyWorkExecutedEvent and BulkTrak.Integration.PublishSubscribe.B2MML_Classes.NotifyWorkReconciledEvent. Either class can be used.
XML Example – MaterialActual Node
See Import Transactions for descriptions of higher-level nodes.
Note: The following example shows a file with a HierarchyScope that has a laboratory location that does not exist in MineMarket. MineMarket matches the results to the applicable samples and process flows using the MaterialLotID and OperationsTestRequirementID.
<?xml version="1.0" encoding="utf-8"?>
<NotifyWorkExecutedEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.mesa.org/xml/B2MML">
<ApplicationArea>
<Sender>
<LogicalID>LIMS</LogicalID>
<ComponentID>UPT</ComponentID>
</Sender>
<CreationDateTime>2024-10-30T04:45:44.9720838+00:00</CreationDateTime>
</ApplicationArea>
<DataArea>
<Notify />
<WorkExecutedEvent>
<ID>59711036-e62b-400c-aa5f-3b0ec8023dd3</ID>
<EventTimestamp>2024-10-30T04:45:44.9720864+00:00</EventTimestamp>
<EventEffectiveTime>2024-10-30T04:45:44.9720862+00:00</EventEffectiveTime>
<AddedJobResponseRecord recordTimestamp="2024-10-30T04:45:44.9720898+00:00" effectiveTimestamp="2024-10-30T23:00:00+00:00">
<JobResponse>
<ID>10B0D26759C0784A7CCDA059EF82C3C5</ID>
<EndTime>2024-10-30T23:00:00+00:00</EndTime>
<HierarchyScope>
<EquipmentID>BusinessAreaAlias1Segment</EquipmentID>
<EquipmentLevel>Enterprise</EquipmentLevel>
<HierarchyScopeChild>
<EquipmentID>BusinessAreaAlias1Segment</EquipmentID>
<EquipmentLevel>Site</EquipmentLevel>
<HierarchyScopeChild>
<EquipmentID>Mine Lab</EquipmentID>
<EquipmentLevel>Area</EquipmentLevel>
</HierarchyScopeChild>
</HierarchyScopeChild>
</HierarchyScope>
<WorkMasterID>Production Sample Analysis</WorkMasterID>
<MaterialActual>
<ID>10B0D26759C0784A7CCDA059EF82C3C5-MA1</ID>
<MaterialDefinitionID>Product Sample</MaterialDefinitionID>
<MaterialLotID>4000000002</MaterialLotID>
<MaterialUse>Consumed</MaterialUse>
<HierarchyScope>
<EquipmentID>BusinessAreaAlias1Segment</EquipmentID>
<EquipmentLevel>Enterprise</EquipmentLevel>
<HierarchyScopeChild>
<EquipmentID>BusinessAreaAlias1Segment</EquipmentID>
<EquipmentLevel>Site</EquipmentLevel>
<HierarchyScopeChild>
<EquipmentID>StockLocationAlias1Segment</EquipmentID>
<EquipmentLevel>Area</EquipmentLevel>
<HierarchyScopeChild>
<EquipmentID>Mine Lab</EquipmentID>
<EquipmentLevel>Area</EquipmentLevel>
</HierarchyScopeChild>
</HierarchyScopeChild>
</HierarchyScopeChild>
</HierarchyScope>
<TestResult>
<ID>10B0D26759C0784A7CCDA059EF82C3C5-MA1-TR1</ID>
<EvaluationDate xsi:nil="true" />
<Expiration xsi:nil="true" />
<HierarchyScope xsi:nil="true" />
<OperationsTestRequirementID>SampleTemplateName</OperationsTestRequirementID>
<EvaluatedCriterionResult xsi:nil="true" />
<PropertyMeasurement>
<ID>AnalyteAlias1</ID>
<MeasurementDate>2024-10-30T23:00:00+00:00</MeasurementDate>
<Value>
<ValueString>68</ValueString>
<DataType>decimal</DataType>
<UnitOfMeasure>UOMAlias1</UnitOfMeasure>
<Key>PRODXRF_XRF</Key>
</Value>
<Expiration xsi:nil="true" />
<WorkDefinitionID xsi:nil="true" />
</PropertyMeasurement>
<PropertyMeasurement>
<ID>AnalyteAlias1</ID>
<MeasurementDate>2024-10-30T23:00:00+00:00</MeasurementDate>
<Value>
<ValueString>24.5</ValueString>
<DataType>decimal</DataType>
<UnitOfMeasure>UOMAlias1</UnitOfMeasure>
<Key>PRODXRF_XRF</Key>
</Value>
<Expiration xsi:nil="true" />
<WorkDefinitionID xsi:nil="true" />
</PropertyMeasurement>
<PropertyMeasurement>
<ID>AnalyteAlias1</ID>
<MeasurementDate>2024-10-30T23:00:00+00:00</MeasurementDate>
<Value>
<ValueString>12</ValueString>
<DataType>decimal</DataType>
<UnitOfMeasure>UOMAlias1</UnitOfMeasure>
<Key>PRODXRF_TGA</Key>
</Value>
<Expiration xsi:nil="true" />
<WorkDefinitionID xsi:nil="true" />
</PropertyMeasurement>
</TestResult>
</MaterialActual>
</JobResponse>
</AddedJobResponseRecord>
</WorkExecutedEvent>
</DataArea>
</NotifyWorkExecutedEvent>
XML Nodes – MaterialActual Node
See Import Transactions for information about descriptions of higher-level nodes.
Node and Path |
Notes |
---|---|
JobResponse » MaterialActual |
The start node for information about a sample. |
MaterialActual » MaterialLotID |
The Alias1 segment of the sample. If the sample does not exist and a process flow can be determined, the sample is created and where possible, assigned to a transaction. The full Alias1 of the sample has the structure SampleTemplate_Sample_ProcessFlow; that is, (Test Result ») ID + "_" + MaterialLotID + "_" + WorkMasterID. If the sample does not exist and a process flow cannot be determined, the sample is created and MineMarket assigns it to a process flow based on the matching look-up value for the sample template name. The full Alias1 of the sample has the structure SampleTemplate_Sample_ProcessFlow; that is, OperationsTestRequirementID + "_" + MaterialLotID + "_" + ProcessFlowAlias1. If multiple matching sample templates are found, a sample is created for each template and the sample results in the TestResult » PropertyMeasurement node are applied to each sample. |
MaterialActual » MaterialUse |
A text string that may be the word "Sample" or "Consumed" (case-insensitive). |
MaterialActual » HierarchyScope |
If the HierarchyScope includes an EquipmentID for a location that does not exist in MineMarket (for example, a laboratory), MineMarket assumes the file contains sample data only. |
MaterialActual » TestResult » OperationsTestRequirementID |
The Name of the sample template (a look-up value, not the Alias1). For each TestResult node, one sample is created for each sample template. Note: If the sample template does not exist, the XML file is rejected. |
MaterialActual » TestResult » PropertyMeasurement |
The start node of zero or more property measurements associated with the sample. |
PropertyMeasurement » ID |
The Alias1 of an analyte. |
PropertyMeasurement » MeasurementDate |
An optional Date of measurement. If this node is not included, the EndTime of the JobResponse is used. |
PropertyMeasurement » Value » ValueString |
The numerical result for the analyte. |
PropertyMeasurement » Value » UnitOfMeasure |
The Alias1 of a unit of measure (UOM). This UOM must match the UOM associated with the analyte. |
XML Example – MaterialLot Node
<?xml version="1.0" encoding="UTF-8"?>
<p:NotifyWorkExecutedEvent xmlns:p="http://www.mesa.org/xml/B2MML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<p:ApplicationArea>
<p:Sender>
<p:LogicalID>PFPCS</p:LogicalID>
<p:ComponentID>TGM1</p:ComponentID>
</p:Sender>
<p:CreationDateTime>2022-11-19T12:00:01Z</p:CreationDateTime>
</p:ApplicationArea>
<p:DataArea>
<p:Notify />
<p:WorkExecutedEvent>
<p:ID>OPE201</p:ID>
<p:HierarchyScope>
<p:EquipmentID>BusinessAreaAlias1Segment</p:EquipmentID>
<p:EquipmentLevel>Enterprise</p:EquipmentLevel>
<p:HierarchyScopeChild>
<p:EquipmentID>BusinessAreaAlias1Segment</p:EquipmentID>
<p:EquipmentLevel>Site</p:EquipmentLevel>
</p:HierarchyScopeChild>
</p:HierarchyScope>
<p:AddedJobResponseRecord>
<p:JobResponse>
<p:ID />
</p:JobResponse>
</p:AddedJobResponseRecord>
<p:ChangedMaterialLotRecord recordTimestamp="2022-11-19T12:00:01Z">
<p:MaterialLot>
<p:ID>SampleAlias1Segment</p:ID>
<p:HierarchyScope>
<p:EquipmentID>Product Stockyard</p:EquipmentID>
<p:EquipmentLevel>Area</p:EquipmentLevel>
</p:HierarchyScope>
<p:MaterialDefinitionID>Port Outflow Sample</p:MaterialDefinitionID>
<p:MaterialLotProperty>
<p:ID>AnalyteAlias1</p:ID>
<p:Value>
<p:ValueString>7.5</p:ValueString>
<p:DataType>Numeric</p:DataType>
<p:UnitOfMeasure>UOMAlias1</p:UnitOfMeasure>
</p:Value>
</p:MaterialLotProperty>
<p:TestSpecificationID>SampleTemplateName</p:TestSpecificationID>
</p:MaterialLot>
</p:ChangedMaterialLotRecord>
</p:WorkExecutedEvent>
</p:DataArea>
</p:NotifyWorkExecutedEvent>
XML Nodes – MaterialLot Node
See Import Transactions for descriptions of higher-level nodes.
Node and Path |
Notes |
---|---|
ChangedMaterialLotRecord or AddedMaterialLotRecord |
The start node for the sample. Includes a timestamp for the sample results. This timestamp is saved in the sample's extended data in the Date7 field. The timestamp is also used as the Results Requested date for samples to indicate the date assayed. If this timestamp is missing the CreationDateTime is used as the Results Requested date. Note: The time must be later than existing data in MineMarket. If the time is earlier than the Date7 field in the extended data of the sample, all data in this ChangedMaterialLotRecord or AddedMaterialLotRecord node is ignored. |
ChangedMaterialLotRecord » MaterialLot » ID or AddedMaterialLotRecord » MaterialLot » ID |
The Alias1 segment of the sample. The results are updated in any existing sample with an Alias1 starting with MaterialTestSpecificationID_ID. If a matching sample does not exist, a sample is created, but is not associated with any transaction. The full Alias1 of the sample has the structure SampleTemplate_Sample_ProcessFlow; that is, MaterialTestSpecificationID + "_" + ID + "_" + WorkMasterID. If a WorkMasterID is not available (because samples are being imported separately to transactions), a sample is created for any matching sample templates. This ID is also used as the sample name if a sample is created. |
MaterialLot » HierarchyScope |
Ignored in processing. |
MaterialLot » MaterialDefinitionID |
A text string that must contain the word "sample" (case-insensitive). |
ChangedMaterialLotRecord » MaterialLotProperty or AddedMaterialLotRecord » MaterialLotProperty |
The start node for an analyte in the sample. |
MaterialLotProperty » ID |
The Alias1 of an analyte definition that is in the specified sample template. Note: If the analyte definition is not in the specified sample template, processing of the XML file fails and no data is saved. If the analyte definition does not exist in MineMarket, the data for the analyte is ignored. |
MaterialLotProperty » Value |
The start node for the analyte result. |
Value » ValueString |
The numerical result for the analyte. |
Value » DataType |
A text string that must be the word "Numeric" (case-sensitive). |
Value » UnitOfMeasure |
The Alias1 of the UOM of the analyte. |
MaterialLot » TestSpecificationID |
The Name of the sample template that is applicable for all samples in the ChangedMaterialLotRecord. |
Notes and Troubleshooting
Nodes not described in the table above do not correspond to MineMarket data and are ignored in processing.
Multiple instances of nodes (with their sub-nodes) can exist within the one file:
- Multiple ChangedMaterialLotRecord or MaterialActual nodes: For importing results for multiple samples in the one file.
- Multiple MaterialLotProperty or PropertyMeasurement nodes: For importing results for multiple analytes in the one sample.
Results Received is set to True when the sample results have been processed.
When the B2MML adaptor processes the XML file, if one sample result causes an error, no sample results are saved. However, any non-numeric or invalid analyte values (for example, "LessThan 0.01" to indicate values below detection limits) are set to null.