message: Validate questionnaire name and id
diff: @@ -29,3 +29,21 @@ export const canBePerformedBy = [
  { code: '1', display: 'Default' },
  { code: '2', display: 'SubjectOnly' },
  ];
  +
  +export const isValidId = (value: string, stateValue: string | undefined): boolean => {
  + // Allow id not matching regex if imported and unchanged
  + if (stateValue && value === stateValue) {
  + return true;
  + }
  + const regExp = /^[A-Za-z0-9-.]{1,64}$/;
  + return regExp.test(value);
  +};
  +
  +export const isValidTechnicalName = (value: string, stateValue: string | undefined): boolean => {
  + // Allow name not matching regex if imported and unchanged
  + if (stateValue && value === stateValue) {
  + return true;
  + }
  + const regExp = /^[A-Z]([A-Za-z0-9_]){0,254}$/;
  + return regExp.test(value);
  +};
  