<commit_before>package uk.nhs.ciao.cda.builder.json;

import java.util.List;

import uk.nhs.interoperability.payloads.HL7Date;
import uk.nhs.interoperability.payloads.commontypes.DateRange;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;

/**
 * Jackson mixins to convert a JSON parsed document into a non-coded CDA document
 * <p>
 * {@link CDABuilderModule} provides a Jackson module pre-configured with the
 * mixins required to handled non coded CDA documents
 * 
 * @see CDABuilderModule
 * @see TransferOfCareCommonFields
 */
class JacksonMixins {
	// disable auto-detect
	@JsonAutoDetect(
			creatorVisibility=Visibility.NONE,
			fieldVisibility=Visibility.NONE,
			getterVisibility=Visibility.NONE,
			isGetterVisibility=Visibility.NONE,
			setterVisibility=Visibility.NONE)
	interface DisabledAutoDetectMixin {}
		
	interface AddressMixin extends DisabledAutoDetectMixin {
		@JsonProperty("line") List<String> getAddressLine();
		@JsonProperty String getCity();
		@JsonProperty String getPostcode();
		@JsonProperty("key") String getAddressKey();
		@JsonProperty("full") String getFullAddress();
		@JsonProperty("use") String getAddressUse();
		@JsonProperty String getNullFlavour();
		@JsonProperty String getDescription();
		@JsonProperty DateRange getUseablePeriod();
	}	
	
	interface PersonNameMixin extends DisabledAutoDetectMixin {
		@JsonProperty String getTitle();
		@JsonProperty List<String> getGivenName();
		@JsonProperty String getFamilyName();
		@JsonProperty String getFullName();
		@JsonProperty String getNameType();
		@JsonProperty String getNullFlavour();
	}
	
	@JsonDeserialize(builder=DateRangeBuilder.class)
	public static abstract class DateRangeMixin implements DisabledAutoDetectMixin {}
	<commit_msg>Fixes for various sonar warnings<commit_after>package uk.nhs.ciao.cda.builder.json;

import java.util.List;

import uk.nhs.interoperability.payloads.HL7Date;
import uk.nhs.interoperability.payloads.commontypes.DateRange;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;

/**
 * Jackson mixins to convert a JSON parsed document into a non-coded CDA document
 * <p>
 * {@link CDABuilderModule} provides a Jackson module pre-configured with the
 * mixins required to handled non coded CDA documents
 * 
 * @see CDABuilderModule
 * @see TransferOfCareCommonFields
 */
class JacksonMixins {
	// disable auto-detect
	@JsonAutoDetect(
			creatorVisibility=Visibility.NONE,
			fieldVisibility=Visibility.NONE,
			getterVisibility=Visibility.NONE,
			isGetterVisibility=Visibility.NONE,
			setterVisibility=Visibility.NONE)
	interface DisabledAutoDetectMixin {
		// Tagging interface to import Jackson annotations - no additional methods required
	}
		
	interface AddressMixin extends DisabledAutoDetectMixin {
		@JsonProperty("line") List<String> getAddressLine();
		@JsonProperty String getCity();
		@JsonProperty String getPostcode();
		@JsonProperty("key") String getAddressKey();
		@JsonProperty("full") String getFullAddress();
		@JsonProperty("use") String getAddressUse();
		@JsonProperty String getNullFlavour();
		@JsonProperty String getDescription();
		@JsonProperty DateRange getUseablePeriod();
	}	
	
	interface PersonNameMixin extends DisabledAutoDetectMixin {
		@JsonProperty String getTitle();
		@JsonProperty List<String> getGivenName();
		@JsonProperty String getFamilyName();
		@JsonProperty String getFullName();
		@JsonProperty String getNameType();
		@JsonProperty String getNullFlavour();
	}
	
	@JsonDeserialize(builder=DateRangeBuilder.class)
	public static abstract class DateRangeMixin implements DisabledAutoDetectMixin {
		// Tagging class to specify Jackson annotations - no additional methods required
	}
	
{'fraction_non_alphanumeric': 0.0903010033444816, 'fraction_numerical': 0.00047778308647873863, 'mean_word_length': 6.157264957264958, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4822403', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1143, 'n_words': 276}