b662e3fbe44e4065be9b59095c9.../README.md
2025-06-25 13:06:28 +00:00

89 lines
3.5 KiB
Markdown

# Add field assessment entries
Field inspections carried out on sections of pipelines.
Field inspections are conducted for various reasons the two most likely are for repairs and for
validation of an ILI report.
Generally for a field inspection a approximately 15 meter long pit will be dug to expose a
complete pipeline joint along with a couple of meters of the proceeding and subsequence joints.
Multiple inspections will be carried out on the exposed joint.
## Input
### Arguments
- `org_id`: as string which should be a valid `uuid` for the organization
- `project_id`: the id of the data project where the pipeline data is found
- `pipeline_id`: an `array` of `strings` which should be valid UUIDs for pipelines
- `date`: a `string` formatted as an ISO date representing the date of the field assessment
- `log_distance`: a `float` representing the log distance of the anomaly measured in meters
- `girth_weld`: a `integer` representing the girth weld number of the joint being inspected
- `anomaly_orientation_hours`: a `integer` representing the circumferential position of the
starting point of the anomaly measured in clock position the hour part
- `anomaly_orientation_minutes`: a `integer` representing the circumferential position of the
starting point of the anomaly measured in clock position the minute part
- `measured_wall_thickness`: a `float` representing the measured wall thickness from a
location not affected by corrosion (i.e the original wall thickness).
- `measured_remaining_wall_thickness`: a `float` representing the measured wall thickness from
the river bottom of the anomaly
- `surface_location`: a `string` the surface location of the anomaly being inspected possible values
- `EXT`: external
- `INT`: internal
- `MID`: midwall
- `UNK`: unknown
- `measured_length`: a `float` representing the measured length of the anomaly
- `measured_width`: a `float` representing the measured width of the anomaly
- `measured_max_depth`: a `float` representing the measured max depth of the anomaly
- `purpose_of_measurement`: a `string` the reason for the measurement (e.g. ILI verification/Repair)
- `tool_accuracy`: a `float` representing the accuracy of the measurement tool
- `pit_gauge_accuracy`: a `float` representing the accuracy of the pit gauge tool.
- `inspector`: a `string` representing the identifier of the inspector
- `remarks`: a `string` for any additional remarks about the inspection
## Creating the function on the platform
To create this function on the platform using the `cli` set up the port forwarding as shown in README.
Then run the following command to create the function.
```bash
cargo run functions create \
-f functions/field_assessment \
-d "Adds field assessment reports" \
-i org_id=string \
-i project_id=string \
-i pipeline_id=array \
-i date=string \
-i log_distance=float \
-i girth_weld=integer \
-i anomaly_orientation_hours=integer \
-i anomaly_orientation_minutes=integer \
-i measured_wall_thickness=float \
-i measured_remaining_wall_thickness=float \
-i surface_location=string \
-i measured_length=float \
-i measured_width=float \
-i measured_max_depth=float \
-i purpose_of_measurement=string \
-i tool_accuracy=float \
-i pit_gauge_accuracy=float \
-i inspector=string \
-i remarks=string
```
## Testing the function locally
You can run and test the function locally by running
```bash
cargo run
```
Then you can check it work with `curl` as follows
```bash
jq '. | tojson' functions/field_assessment/example_input.json | curl -d '@-' localhost:8080
```